Skip to content

Commit 79ba34b

Browse files
committed
Make scoped_render_pass apply the label to the render pass
1 parent 887fd5a commit 79ba34b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/scope.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ macro_rules! impl_scope_ext {
9999
/// Ignores passed `wgpu::RenderPassDescriptor::timestamp_writes` and replaces it with
100100
/// `timestamp_writes` managed by `GpuProfiler` if profiling is enabled.
101101
///
102+
/// This also sets the `wgpu::RenderPassDescriptor::label` if it's `None` (default).
103+
///
102104
/// Note that in order to take measurements, this requires the [`wgpu::Features::TIMESTAMP_QUERY`] feature.
103105
/// [`wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS`] & [`wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES`] are not required.
104106
#[track_caller]
@@ -116,6 +118,7 @@ macro_rules! impl_scope_ext {
116118
.recorder
117119
.begin_render_pass(&wgpu::RenderPassDescriptor {
118120
timestamp_writes: child_scope.render_pass_timestamp_writes(),
121+
label: pass_descriptor.label.or(Some(&child_scope.label)),
119122
..pass_descriptor
120123
});
121124

0 commit comments

Comments
 (0)