Skip to content

Commit

Permalink
Fix issue with multiple queued mappings where the last one is not can…
Browse files Browse the repository at this point in the history
…celled
  • Loading branch information
Imberflur committed Feb 28, 2021
1 parent ecbdded commit 2c153f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wgpu-core/src/device/life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ impl<B: GfxBackend> LifetimeTracker<B> {
resource::BufferMapState::Waiting(pending_mapping) => pending_mapping,
// Mapping cancelled
resource::BufferMapState::Idle => continue,
// Mapping queued at least twice by map -> unmap -> map
// and was already successfully mapped below
active @ resource::BufferMapState::Active { .. } => {
buffer.map_state = active;
continue;
}
_ => panic!("No pending mapping."),
};
let status = if mapping.range.start != mapping.range.end {
Expand Down

0 comments on commit 2c153f5

Please sign in to comment.