Skip to content

Commit

Permalink
don't panic on mapped buffer in queue_submit (#3364)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Jan 15, 2023
1 parent fac4731 commit f40611f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion wgpu-core/src/device/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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)),
}
}
}
Expand Down

0 comments on commit f40611f

Please sign in to comment.