1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

[egui-wgpu] Device configuration is now dependent on adapter (#2951)

* [egui-wgpu] Device configuration is now dependent on adapter
Additionally, renamed `backends` into `supported_backends` and improved & unified wgpu config defaults.

* improve wgpu backend default

* clippy fix

* formatting

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Andreas Reich
2023-04-25 09:53:13 +02:00
committed by GitHub
parent 92c7053a14
commit 20e291d3f6
4 changed files with 35 additions and 34 deletions

View File

@@ -497,21 +497,7 @@ impl Default for WebOptions {
webgl_context_option: WebGlContextOption::BestFirst,
#[cfg(feature = "wgpu")]
wgpu_options: egui_wgpu::WgpuConfiguration {
// Use WebGPU or WebGL. Note that WebGL needs to be opted in via a wgpu feature.
backends: wgpu::Backends::BROWSER_WEBGPU | wgpu::Backends::GL,
device_descriptor: wgpu::DeviceDescriptor {
label: Some("egui wgpu device"),
features: wgpu::Features::default(),
limits: wgpu::Limits {
// When using a depth buffer, we have to be able to create a texture
// large enough for the entire surface, and we want to support 4k+ displays.
max_texture_dimension_2d: 8192,
..wgpu::Limits::downlevel_webgl2_defaults()
},
},
..Default::default()
},
wgpu_options: egui_wgpu::WgpuConfiguration::default(),
}
}
}