diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index d733d4236..afb839007 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -395,11 +395,16 @@ impl CommandEncoder { /// its own label. /// /// The underlying hal encoder is put in the "recording" state. + /// + /// # Panics + /// + /// - If the encoder is already open. pub(crate) fn open_pass( &mut self, label: Option<&str>, device: &Device, ) -> Result<&mut dyn hal::DynCommandEncoder, DeviceError> { + assert!(!self.is_open); self.is_open = true; let hal_label = hal_label(label, device.instance_flags);