591: Warn when binding a buffer that is still mapped r=kvark a=almarklein

Fixes #510

I'd like to make more contributions wrt validation. Though I'm quite new to Rust, so let's start small :)  

From the discussion in #510 I concluded that in this case the buffer has actually been dropped, does the error message make sense like this?

Do the messages logged with `log::warn`, end up in the same logging system as the layer validation messages? So a solution to get those messages into Python (for wgpu-py) would work for both kinds of validation messages?


Co-authored-by: Almar Klein <almar.klein@gmail.com>
This commit is contained in:
bors[bot]
2020-04-17 21:15:19 +00:00
committed by GitHub

View File

@@ -1461,6 +1461,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
}
if !buffer_guard[id].life_guard.use_at(submit_index) {
if let resource::BufferMapState::Active = buffer_guard[id].map_state {
log::warn!("Dropped buffer has a pending mapping.");
unmap_buffer(&device.raw, &mut buffer_guard[id]);
}
device.temp_suspected.buffers.push(id);