Fix issue with multiple queued mappings where the last one is not cancelled

This commit is contained in:
Imbris 2021-02-28 00:56:17 -05:00
parent ecbddedfaf
commit 2c153f5d50

View File

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