Skip to content

Commit

Permalink
Fix nesting of the WGPU profiling (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab authored and simbleau committed Feb 20, 2024
1 parent 79d1a2d commit 82c8813
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/wgpu_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ impl WgpuEngine {
)?;
let mut cpass = encoder.begin_compute_pass(&Default::default());
#[cfg(feature = "wgpu-profiler")]
let query = profiler.begin_query(shader.label, &mut cpass, device);
let query = profiler
.begin_query(shader.label, &mut cpass, device)
.with_parent(Some(&query));
cpass.set_pipeline(&wgpu_shader.pipeline);
cpass.set_bind_group(0, &bind_group, &[]);
cpass.dispatch_workgroups(wg_size.0, wg_size.1, wg_size.2);
Expand Down Expand Up @@ -448,7 +450,9 @@ impl WgpuEngine {
);
let mut cpass = encoder.begin_compute_pass(&Default::default());
#[cfg(feature = "wgpu-profiler")]
let query = profiler.begin_query(shader.label, &mut cpass, device);
let query = profiler
.begin_query(shader.label, &mut cpass, device)
.with_parent(Some(&query));
cpass.set_pipeline(&wgpu_shader.pipeline);
cpass.set_bind_group(0, &bind_group, &[]);
let buf = self
Expand Down

0 comments on commit 82c8813

Please sign in to comment.