make open_pass panic if the encoder is open

This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2024-12-20 15:44:15 +01:00
1 parent 0fed4dbc16
commit 7b2a561402
1 file changed
+5
+5
View File
@@ -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);