mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
fix check for flush_mapped_ranges
in map_buffer
`flush_mapped_ranges` needs to be called when mappings are not coherent. We can also omit flushing for write-mapped buffers since we always flush them on unmap.
This commit is contained in:
parent
f0875e8fda
commit
a6bc2f6f53
@ -349,7 +349,7 @@ fn map_buffer<A: HalApi>(
|
||||
(uninitialized.start - offset) as usize..(uninitialized.end - offset) as usize;
|
||||
mapped[fill_range].fill(0);
|
||||
|
||||
if mapping.is_coherent {
|
||||
if !mapping.is_coherent && kind == HostMap::Read {
|
||||
unsafe { raw.flush_mapped_ranges(raw_buffer, iter::once(uninitialized)) };
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user