Skip to content

Commit

Permalink
Make scoped_render_pass apply the label to the render pass (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone authored Oct 18, 2024
1 parent 887fd5a commit 39ac2e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ macro_rules! impl_scope_ext {
/// Ignores passed `wgpu::RenderPassDescriptor::timestamp_writes` and replaces it with
/// `timestamp_writes` managed by `GpuProfiler` if profiling is enabled.
///
/// This also sets the `wgpu::RenderPassDescriptor::label` if it's `None` (default).
///
/// Note that in order to take measurements, this requires the [`wgpu::Features::TIMESTAMP_QUERY`] feature.
/// [`wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS`] & [`wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES`] are not required.
#[track_caller]
Expand All @@ -116,6 +118,7 @@ macro_rules! impl_scope_ext {
.recorder
.begin_render_pass(&wgpu::RenderPassDescriptor {
timestamp_writes: child_scope.render_pass_timestamp_writes(),
label: pass_descriptor.label.or(Some(&child_scope.label)),
..pass_descriptor
});

Expand Down

0 comments on commit 39ac2e1

Please sign in to comment.