@@ -179,7 +179,7 @@ async fn draw_test_with_reports(
179179
180180 let global_report = ctx. instance . generate_report ( ) . unwrap ( ) ;
181181 let report = global_report. hub_report ( ) ;
182- assert_eq ! ( report. command_buffers . num_allocated, 1 ) ;
182+ assert_eq ! ( report. command_encoders . num_allocated, 1 ) ;
183183 assert_eq ! ( report. buffers. num_allocated, 1 ) ;
184184
185185 let mut rpass = encoder. begin_render_pass ( & wgpu:: RenderPassDescriptor {
@@ -206,7 +206,7 @@ async fn draw_test_with_reports(
206206 assert_eq ! ( report. pipeline_layouts. num_allocated, 1 ) ;
207207 assert_eq ! ( report. render_pipelines. num_allocated, 1 ) ;
208208 assert_eq ! ( report. compute_pipelines. num_allocated, 0 ) ;
209- assert_eq ! ( report. command_buffers . num_allocated, 1 ) ;
209+ assert_eq ! ( report. command_encoders . num_allocated, 1 ) ;
210210 assert_eq ! ( report. render_bundles. num_allocated, 0 ) ;
211211 assert_eq ! ( report. texture_views. num_allocated, 1 ) ;
212212 assert_eq ! ( report. textures. num_allocated, 1 ) ;
@@ -223,15 +223,15 @@ async fn draw_test_with_reports(
223223
224224 let global_report = ctx. instance . generate_report ( ) . unwrap ( ) ;
225225 let report = global_report. hub_report ( ) ;
226- assert_eq ! ( report. command_buffers . num_kept_from_user, 1 ) ;
226+ assert_eq ! ( report. command_encoders . num_kept_from_user, 1 ) ;
227227 assert_eq ! ( report. render_pipelines. num_kept_from_user, 0 ) ;
228228 assert_eq ! ( report. pipeline_layouts. num_kept_from_user, 0 ) ;
229229 assert_eq ! ( report. bind_group_layouts. num_kept_from_user, 0 ) ;
230230 assert_eq ! ( report. bind_groups. num_kept_from_user, 0 ) ;
231231 assert_eq ! ( report. buffers. num_kept_from_user, 0 ) ;
232232 assert_eq ! ( report. texture_views. num_kept_from_user, 0 ) ;
233233 assert_eq ! ( report. textures. num_kept_from_user, 0 ) ;
234- assert_eq ! ( report. command_buffers . num_allocated, 1 ) ;
234+ assert_eq ! ( report. command_encoders . num_allocated, 1 ) ;
235235 assert_eq ! ( report. render_pipelines. num_allocated, 0 ) ;
236236 assert_eq ! ( report. pipeline_layouts. num_allocated, 0 ) ;
237237 assert_eq ! ( report. bind_group_layouts. num_allocated, 0 ) ;
@@ -240,12 +240,18 @@ async fn draw_test_with_reports(
240240 assert_eq ! ( report. texture_views. num_allocated, 0 ) ;
241241 assert_eq ! ( report. textures. num_allocated, 0 ) ;
242242
243- let submit_index = ctx. queue . submit ( Some ( encoder. finish ( ) ) ) ;
243+ let command_buffer = encoder. finish ( ) ;
244+
245+ let global_report = ctx. instance . generate_report ( ) . unwrap ( ) ;
246+ let report = global_report. hub_report ( ) ;
247+ assert_eq ! ( report. command_encoders. num_allocated, 0 ) ;
248+ assert_eq ! ( report. command_buffers. num_allocated, 1 ) ;
249+
250+ let submit_index = ctx. queue . submit ( Some ( command_buffer) ) ;
244251
245- // TODO: fix in https://github.com/gfx-rs/wgpu/pull/5141
246- // let global_report = ctx.instance.generate_report().unwrap();
247- // let report = global_report.hub_report();
248- // assert_eq!(report.command_buffers.num_allocated, 0);
252+ let global_report = ctx. instance . generate_report ( ) . unwrap ( ) ;
253+ let report = global_report. hub_report ( ) ;
254+ assert_eq ! ( report. command_buffers. num_allocated, 0 ) ;
249255
250256 ctx. async_poll ( wgpu:: PollType :: wait_for ( submit_index) )
251257 . await
0 commit comments