mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
[wgpu] Expose wgpu::Adapter via RenderState (#2954)
* [wgpu] Expose adapter, better errors, better docs, more code sharing, use stencil bits * doc fix * remove unnecessary unsafe * handle missing framebuffer format * better handling of renderstate creation in winit.rs * remove unnecessary use directive
This commit is contained in:
@@ -312,10 +312,6 @@ pub struct NativeOptions {
|
||||
/// Sets the number of bits in the depth buffer.
|
||||
///
|
||||
/// `egui` doesn't need the depth buffer, so the default value is 0.
|
||||
///
|
||||
/// On `wgpu` backends, due to limited depth texture format options, this
|
||||
/// will be interpreted as a boolean (non-zero = true) for whether or not
|
||||
/// specifically a `Depth32Float` buffer is used.
|
||||
pub depth_buffer: u8,
|
||||
|
||||
/// Sets the number of bits in the stencil buffer.
|
||||
@@ -475,6 +471,12 @@ pub struct WebOptions {
|
||||
/// Default: `Theme::Dark`.
|
||||
pub default_theme: Theme,
|
||||
|
||||
/// Sets the number of bits in the depth buffer.
|
||||
///
|
||||
/// `egui` doesn't need the depth buffer, so the default value is 0.
|
||||
/// Unused by webgl context as of writing.
|
||||
pub depth_buffer: u8,
|
||||
|
||||
/// Which version of WebGl context to select
|
||||
///
|
||||
/// Default: [`WebGlContextOption::BestFirst`].
|
||||
@@ -492,6 +494,7 @@ impl Default for WebOptions {
|
||||
Self {
|
||||
follow_system_theme: true,
|
||||
default_theme: Theme::Dark,
|
||||
depth_buffer: 0,
|
||||
|
||||
#[cfg(feature = "glow")]
|
||||
webgl_context_option: WebGlContextOption::BestFirst,
|
||||
|
||||
Reference in New Issue
Block a user