@@ -86,26 +86,18 @@ fn main() -> ExitCode {
8686 }
8787 #[ cfg( feature = "wgpu" ) ]
8888 {
89- use eframe:: egui_wgpu:: { wgpu:: Backends , WgpuSetup } ;
89+ use eframe:: egui_wgpu:: { wgpu, WgpuSetup } ;
9090 if graphics_config. desired_backend . is_supported ( ) {
9191 native_options. wgpu_options . wgpu_setup = match native_options. wgpu_options . wgpu_setup {
92- WgpuSetup :: CreateNew {
93- supported_backends : backends,
94- power_preference,
95- device_descriptor,
96- } => {
97- let backend = match graphics_config. desired_backend {
98- GraphicsBackend :: Auto => backends,
99- GraphicsBackend :: Dx12 => Backends :: DX12 ,
100- GraphicsBackend :: Metal => Backends :: METAL ,
101- GraphicsBackend :: Vulkan => Backends :: VULKAN ,
102- GraphicsBackend :: OpenGL => Backends :: GL ,
92+ WgpuSetup :: CreateNew ( mut setup) => {
93+ setup. instance_descriptor . backends = match graphics_config. desired_backend {
94+ GraphicsBackend :: Auto => setup. instance_descriptor . backends ,
95+ GraphicsBackend :: Dx12 => wgpu:: Backends :: DX12 ,
96+ GraphicsBackend :: Metal => wgpu:: Backends :: METAL ,
97+ GraphicsBackend :: Vulkan => wgpu:: Backends :: VULKAN ,
98+ GraphicsBackend :: OpenGL => wgpu:: Backends :: GL ,
10399 } ;
104- WgpuSetup :: CreateNew {
105- supported_backends : backend,
106- power_preference,
107- device_descriptor,
108- }
100+ WgpuSetup :: CreateNew ( setup)
109101 }
110102 // WgpuConfiguration::Default is CreateNew until we call run_eframe()
111103 _ => unreachable ! ( ) ,
0 commit comments