@@ -5,7 +5,7 @@ use vger::*;
55pub async fn setup ( ) -> ( wgpu:: Device , wgpu:: Queue ) {
66 let instance_desc = wgpu:: InstanceDescriptor :: default ( ) ;
77
8- let instance = wgpu:: Instance :: new ( instance_desc) ;
8+ let instance = wgpu:: Instance :: new ( & instance_desc) ;
99
1010 let adapter = wgpu:: util:: initialize_adapter_from_env_or_default ( & instance, None )
1111 . await
@@ -14,17 +14,15 @@ pub async fn setup() -> (wgpu::Device, wgpu::Queue) {
1414 let adapter_info = adapter. get_info ( ) ;
1515 println ! ( "Using {} ({:?})" , adapter_info. name, adapter_info. backend) ;
1616
17- let trace_dir = std:: env:: var ( "WGPU_TRACE" ) ;
17+ let _trace_dir = std:: env:: var ( "WGPU_TRACE" ) ;
1818 adapter
19- . request_device (
20- & wgpu:: DeviceDescriptor {
21- label : None ,
22- required_features : wgpu:: Features :: default ( ) ,
23- required_limits : wgpu:: Limits :: default ( ) ,
24- memory_hints : wgpu:: MemoryHints :: Performance ,
25- } ,
26- trace_dir. ok ( ) . as_ref ( ) . map ( std:: path:: Path :: new) ,
27- )
19+ . request_device ( & wgpu:: DeviceDescriptor {
20+ label : None ,
21+ required_features : wgpu:: Features :: default ( ) ,
22+ required_limits : wgpu:: Limits :: default ( ) ,
23+ memory_hints : wgpu:: MemoryHints :: Performance ,
24+ trace : wgpu:: Trace :: Off ,
25+ } )
2826 . await
2927 . expect ( "Unable to find a suitable GPU adapter!" )
3028}
@@ -49,7 +47,7 @@ pub async fn create_png(
4947 // Poll the device in a blocking manner so that our future resolves.
5048 // In an actual application, `device.poll(...)` should
5149 // be called in an event loop or on another thread.
52- device. poll ( wgpu:: Maintain :: Wait ) ;
50+ device. poll ( wgpu:: PollType :: Wait ) ;
5351 // If a file system is available, write the buffer as a PNG
5452 let has_file_system_available = cfg ! ( not( target_arch = "wasm32" ) ) ;
5553 if !has_file_system_available {
@@ -112,9 +110,9 @@ fn get_texture_data(
112110 // Copy the data from the texture to the buffer
113111 encoder. copy_texture_to_buffer (
114112 texture. as_image_copy ( ) ,
115- wgpu:: ImageCopyBuffer {
113+ wgpu:: TexelCopyBufferInfo {
116114 buffer : & output_buffer,
117- layout : wgpu:: ImageDataLayout {
115+ layout : wgpu:: TexelCopyBufferLayout {
118116 offset : 0 ,
119117 bytes_per_row : Some ( texture_extent. width * bytes_per_pixel) ,
120118 rows_per_image : None ,
@@ -128,7 +126,7 @@ fn get_texture_data(
128126
129127 queue. submit ( Some ( command_buffer) ) ;
130128
131- device. poll ( wgpu:: Maintain :: Wait ) ;
129+ device. poll ( wgpu:: PollType :: Wait ) ;
132130
133131 output_buffer
134132}
@@ -141,7 +139,7 @@ pub fn render_test(
141139 capture : bool ,
142140) {
143141 if capture {
144- device. start_capture ( ) ;
142+ unsafe { device. start_graphics_debugger_capture ( ) }
145143 }
146144
147145 let texture_size = wgpu:: Extent3d {
@@ -174,6 +172,7 @@ pub fn render_test(
174172 load : wgpu:: LoadOp :: Clear ( wgpu:: Color :: BLACK ) ,
175173 store : wgpu:: StoreOp :: Store ,
176174 } ,
175+ depth_slice : None ,
177176 } ) ] ,
178177 depth_stencil_attachment : None ,
179178 occlusion_query_set : None ,
@@ -185,7 +184,7 @@ pub fn render_test(
185184 let output_buffer = get_texture_data ( & texture_desc, device, queue, & render_texture) ;
186185
187186 if capture {
188- device. stop_capture ( ) ;
187+ unsafe { device. stop_graphics_debugger_capture ( ) }
189188 }
190189
191190 block_on ( create_png ( name, device, output_buffer, & texture_desc) ) ;
0 commit comments