diff --git a/CHANGELOG.md b/CHANGELOG.md index cd8f1ee4de..0cde0f075e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -182,6 +182,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non - Improve error messages when binding bind group with dynamic offsets. By @cwfitzgerald in [#3294](https://github.com/gfx-rs/wgpu/pull/3294) - Allow non-filtering sampling of integer textures. By @JMS55 in [#3362](https://github.com/gfx-rs/wgpu/pull/3362). - Validate texture ids in `Global::queue_texture_write`. By @jimblandy in [#3378](https://github.com/gfx-rs/wgpu/pull/3378). +- Don't panic on mapped buffer in queue_submit. By @crowlKats in [#3364](https://github.com/gfx-rs/wgpu/pull/3364). #### Metal - Fix texture view creation with full-resource views when using an explicit `mip_level_count` or `array_layer_count`. By @cwfitzgerald in [#3323](https://github.com/gfx-rs/wgpu/pull/3323) diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 2f4b2bcfb4..dd65d77819 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -307,6 +307,8 @@ pub enum QueueSubmitError { DestroyedTexture(id::TextureId), #[error(transparent)] Unmap(#[from] BufferAccessError), + #[error("Buffer {0:?} is still mapped")] + BufferStillMapped(id::BufferId), #[error("surface output was dropped before the command buffer got submitted")] SurfaceOutputDropped, #[error("surface was unconfigured before the command buffer got submitted")] @@ -910,7 +912,7 @@ impl Global { } else { match buffer.map_state { BufferMapState::Idle => (), - _ => panic!("Buffer {:?} is still mapped", id), + _ => return Err(QueueSubmitError::BufferStillMapped(id.0)), } } }