mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 15:00:57 +01: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:
1 parent
f0875e8fda
commit
a6bc2f6f53
1 file changed
+1
-1
@@ -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)) };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user