From 787aa723a1ef96a9604df58ce7321bda139fdeea Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Mon, 20 Oct 2025 15:45:06 -0700 Subject: [PATCH] Remove `!encoder.is_open` assertion The encoder will be open if `CommandEncoder::as_hal_mut` has been used. --- CHANGELOG.md | 8 ++++++++ wgpu-core/src/command/mod.rs | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e09ec41a..99c6112f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,10 +42,18 @@ Bottom level categories: ### Bug Fixes +#### General + +- Remove an assertion that causes problems if `CommandEncoder::as_hal_mut` is used. By @andyleiserson in [#8387](https://github.com/gfx-rs/wgpu/pull/8387). + #### DX12 - Align copies b/w textures and buffers via a single intermediate buffer per copy when `D3D12_FEATURE_DATA_D3D12_OPTIONS13.UnrestrictedBufferTextureCopyPitchSupported` is `false`. By @ErichDonGubler in [#7721](https://github.com/gfx-rs/wgpu/pull/7721). +#### Naga + +- Fix a bug that resulted in the Metal error `program scope variable must reside in constant address space` in some cases. Backport of [#8311](https://github.com/gfx-rs/wgpu/pull/8311) by @teoxoy. + ## v27.0.2 (2025-10-03) ### Bug Fixes diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 887c19fb3..ccc1a850d 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -357,11 +357,7 @@ impl CommandEncoderStatus { // Replace our state with `Consumed`, and return either the inner // state or an error, to be transferred to the command buffer. match mem::replace(self, Self::Consumed) { - Self::Recording(inner) => { - // Nothing should have opened the encoder yet. - assert!(!inner.encoder.is_open); - Self::Finished(inner) - } + Self::Recording(inner) => Self::Finished(inner), Self::Consumed | Self::Finished(_) => Self::Error(EncoderStateError::Ended.into()), Self::Locked(_) => Self::Error(EncoderStateError::Locked.into()), st @ Self::Error(_) => st,