don't panic on mapped buffer in queue_submit (#3364)

This commit is contained in:
Leo Kettmeir 2023-01-15 07:10:11 +01:00 committed by GitHub
parent fac4731288
commit f40611fd5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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<G: GlobalIdentityHandlerFactory> Global<G> {
} else {
match buffer.map_state {
BufferMapState::Idle => (),
_ => panic!("Buffer {:?} is still mapped", id),
_ => return Err(QueueSubmitError::BufferStillMapped(id.0)),
}
}
}