mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Fix buffer unmap warning
This commit is contained in:
parent
8d1185f3e9
commit
a0701b41cb
@ -2,7 +2,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* Generated with cbindgen:0.14.0 */
|
||||
/* Generated with cbindgen:0.14.1 */
|
||||
|
||||
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
|
||||
* To generate this file:
|
||||
|
@ -142,14 +142,6 @@ fn map_buffer<B: hal::Backend>(
|
||||
}
|
||||
|
||||
fn unmap_buffer<B: hal::Backend>(raw: &B::Device, buffer: &mut resource::Buffer<B>) {
|
||||
match buffer.map_state {
|
||||
resource::BufferMapState::Idle => {
|
||||
log::error!("Buffer already unmapped");
|
||||
return;
|
||||
}
|
||||
_ => buffer.map_state = resource::BufferMapState::Idle,
|
||||
}
|
||||
|
||||
if !buffer.mapped_write_segments.is_empty() {
|
||||
unsafe {
|
||||
raw.flush_mapped_memory_ranges(
|
||||
@ -2142,6 +2134,14 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let buffer = &mut buffer_guard[buffer_id];
|
||||
|
||||
log::debug!("Buffer {:?} map state -> Idle", buffer_id);
|
||||
unmap_buffer(&device_guard[buffer.device_id.value].raw, buffer);
|
||||
match buffer.map_state {
|
||||
resource::BufferMapState::Idle => {
|
||||
log::error!("Buffer already unmapped");
|
||||
}
|
||||
_ => {
|
||||
buffer.map_state = resource::BufferMapState::Idle;
|
||||
unmap_buffer(&device_guard[buffer.device_id.value].raw, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user