mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 18:14:18 +01:00
Panic on using a pending buffer
This commit is contained in:
1 parent
8a038ba66e
commit
b7695ceac3
1 file changed
+9
-6
@@ -441,15 +441,18 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
// update submission IDs
|
||||
for id in comb.trackers.buffers.used() {
|
||||
if let BufferMapState::Waiting(_) = buffer_guard[id].map_state {
|
||||
panic!("Buffer has a pending mapping.");
|
||||
}
|
||||
if !buffer_guard[id].life_guard.use_at(submit_index) {
|
||||
if let BufferMapState::Active { .. } = buffer_guard[id].map_state {
|
||||
let buffer = &mut buffer_guard[id];
|
||||
if !buffer.life_guard.use_at(submit_index) {
|
||||
if let BufferMapState::Active { .. } = buffer.map_state {
|
||||
log::warn!("Dropped buffer has a pending mapping.");
|
||||
super::unmap_buffer(&device.raw, &mut buffer_guard[id]);
|
||||
super::unmap_buffer(&device.raw, buffer);
|
||||
}
|
||||
device.temp_suspected.buffers.push(id);
|
||||
} else {
|
||||
match buffer.map_state {
|
||||
BufferMapState::Idle => (),
|
||||
_ => panic!("Buffer {:?} is still mapped", id),
|
||||
}
|
||||
}
|
||||
}
|
||||
for id in comb.trackers.textures.used() {
|
||||
|
||||
Reference in new issue
Block a user