@@ -123,14 +123,13 @@ where
123123
124124 fn init ( ) -> anyhow:: Result < ( wgpu:: Device , wgpu:: Queue ) > {
125125 block_on ( async {
126- let instance = wgpu:: Instance :: new ( wgpu:: InstanceDescriptor {
126+ let instance = wgpu:: Instance :: new ( & wgpu:: InstanceDescriptor {
127127 #[ cfg( target_os = "linux" ) ]
128128 backends : wgpu:: Backends :: VULKAN ,
129129 #[ cfg( not( target_os = "linux" ) ) ]
130130 backends : wgpu:: Backends :: PRIMARY ,
131- dx12_shader_compiler : Default :: default ( ) ,
132131 flags : Default :: default ( ) ,
133- gles_minor_version : Default :: default ( ) ,
132+ backend_options : Default :: default ( ) ,
134133 } ) ;
135134 let adapter = instance
136135 . request_adapter ( & wgpu:: RequestAdapterOptions {
@@ -141,18 +140,16 @@ where
141140 . await
142141 . context ( "Failed to find a suitable GPU adapter" ) ?;
143142 let ( device, queue) = adapter
144- . request_device (
145- & wgpu:: DeviceDescriptor {
146- label : Some ( "wgpu Device" ) ,
147- #[ cfg( target_os = "linux" ) ]
148- required_features : wgpu:: Features :: SPIRV_SHADER_PASSTHROUGH ,
149- #[ cfg( not( target_os = "linux" ) ) ]
150- required_features : wgpu:: Features :: empty ( ) ,
151- required_limits : wgpu:: Limits :: default ( ) ,
152- memory_hints : Default :: default ( ) ,
153- } ,
154- None ,
155- )
143+ . request_device ( & wgpu:: DeviceDescriptor {
144+ label : Some ( "wgpu Device" ) ,
145+ #[ cfg( target_os = "linux" ) ]
146+ required_features : wgpu:: Features :: SPIRV_SHADER_PASSTHROUGH ,
147+ #[ cfg( not( target_os = "linux" ) ) ]
148+ required_features : wgpu:: Features :: empty ( ) ,
149+ required_limits : wgpu:: Limits :: default ( ) ,
150+ memory_hints : Default :: default ( ) ,
151+ trace : Default :: default ( ) ,
152+ } )
156153 . await
157154 . context ( "Failed to create device" ) ?;
158155 Ok ( ( device, queue) )
@@ -255,7 +252,7 @@ where
255252 buffer_slice. map_async ( wgpu:: MapMode :: Read , move |res| {
256253 let _ = sender. send ( res) ;
257254 } ) ;
258- device. poll ( wgpu:: Maintain :: Wait ) ;
255+ device. poll ( wgpu:: PollType :: Wait ) ? ;
259256 block_on ( receiver)
260257 . context ( "mapping canceled" ) ?
261258 . context ( "mapping failed" ) ?;
0 commit comments