1
0
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:
Andreas Reich
2023-04-25 17:42:13 +02:00
committed by GitHub
parent 20e291d3f6
commit f76eefb98d
9 changed files with 138 additions and 153 deletions

View File

@@ -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,