@@ -123,14 +123,13 @@ where
123
123
124
124
fn init ( ) -> anyhow:: Result < ( wgpu:: Device , wgpu:: Queue ) > {
125
125
block_on ( async {
126
- let instance = wgpu:: Instance :: new ( wgpu:: InstanceDescriptor {
126
+ let instance = wgpu:: Instance :: new ( & wgpu:: InstanceDescriptor {
127
127
#[ cfg( target_os = "linux" ) ]
128
128
backends : wgpu:: Backends :: VULKAN ,
129
129
#[ cfg( not( target_os = "linux" ) ) ]
130
130
backends : wgpu:: Backends :: PRIMARY ,
131
- dx12_shader_compiler : Default :: default ( ) ,
132
131
flags : Default :: default ( ) ,
133
- gles_minor_version : Default :: default ( ) ,
132
+ backend_options : Default :: default ( ) ,
134
133
} ) ;
135
134
let adapter = instance
136
135
. request_adapter ( & wgpu:: RequestAdapterOptions {
@@ -141,18 +140,16 @@ where
141
140
. await
142
141
. context ( "Failed to find a suitable GPU adapter" ) ?;
143
142
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
+ } )
156
153
. await
157
154
. context ( "Failed to create device" ) ?;
158
155
Ok ( ( device, queue) )
@@ -255,7 +252,7 @@ where
255
252
buffer_slice. map_async ( wgpu:: MapMode :: Read , move |res| {
256
253
let _ = sender. send ( res) ;
257
254
} ) ;
258
- device. poll ( wgpu:: Maintain :: Wait ) ;
255
+ device. poll ( wgpu:: PollType :: Wait ) ? ;
259
256
block_on ( receiver)
260
257
. context ( "mapping canceled" ) ?
261
258
. context ( "mapping failed" ) ?;
0 commit comments