diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 44b65b6d6..b997c01f8 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -416,7 +416,9 @@ impl Global { // we want to insert a command buffer _before_ what we're about to record, // we need to make sure to close the previous one. encoder.close(&cmd_buf.device).map_pass_err(pass_scope)?; - let raw_encoder = encoder.open(&cmd_buf.device).map_pass_err(pass_scope)?; + let raw_encoder = encoder + .open_pass(base.label.as_deref(), &cmd_buf.device) + .map_pass_err(pass_scope)?; let mut state = State { binder: Binder::new(), @@ -599,7 +601,9 @@ impl Global { // Create a new command buffer, which we will insert _before_ the body of the compute pass. // // Use that buffer to insert barriers and clear discarded images. - let transit = encoder.open(&cmd_buf.device).map_pass_err(pass_scope)?; + let transit = encoder + .open_pass(Some("(wgpu internal) Pre Pass"), &cmd_buf.device) + .map_pass_err(pass_scope)?; fixup_discarded_surfaces( pending_discard_init_fixups.into_iter(), transit, diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 26dd581fd..50b12c9cd 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -379,13 +379,13 @@ impl CommandEncoder { &mut self, label: Option<&str>, device: &Device, - ) -> Result<(), DeviceError> { + ) -> Result<&mut dyn hal::DynCommandEncoder, DeviceError> { self.is_open = true; let hal_label = hal_label(label, device.instance_flags); unsafe { self.raw.begin_encoding(hal_label) }.map_err(|e| device.handle_hal_error(e))?; - Ok(()) + Ok(self.raw.as_mut()) } } diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 33a0e06a4..b466a04a5 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1977,7 +1977,9 @@ impl Global { let tracker = &mut cmd_buf_data.trackers; { - let transit = encoder.open(&cmd_buf.device).map_pass_err(pass_scope)?; + let transit = encoder + .open_pass(Some("(wgpu internal) Pre Pass"), &cmd_buf.device) + .map_pass_err(pass_scope)?; fixup_discarded_surfaces( pending_discard_init_fixups.into_iter(),