@@ -86,26 +86,18 @@ fn main() -> ExitCode {
86
86
}
87
87
#[ cfg( feature = "wgpu" ) ]
88
88
{
89
- use eframe:: egui_wgpu:: { wgpu:: Backends , WgpuSetup } ;
89
+ use eframe:: egui_wgpu:: { wgpu, WgpuSetup } ;
90
90
if graphics_config. desired_backend . is_supported ( ) {
91
91
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 ,
103
99
} ;
104
- WgpuSetup :: CreateNew {
105
- supported_backends : backend,
106
- power_preference,
107
- device_descriptor,
108
- }
100
+ WgpuSetup :: CreateNew ( setup)
109
101
}
110
102
// WgpuConfiguration::Default is CreateNew until we call run_eframe()
111
103
_ => unreachable ! ( ) ,
0 commit comments