Open nical opened 9 months ago
Looks like we should detect when a buffer that has pending writes is mapped again and either:
I think we can defer unmapping & putting the staging buffer in pending writes to the beginning of a submission that uses the buffer.
Consequently this would also fix point 1 of https://github.com/gfx-rs/wgpu/issues/6053.
Description
This is visible during CTS runs, but it was already filed against wgpu-native a while back in https://github.com/gfx-rs/wgpu-native/issues/305.
See the test below. It creates a mapped buffer, writes data into it, unmaps it, maps it again and checks that the content matches what was written.
Repro steps
Expected vs observed behavior
The above test should pass but currently doesn't unless the submit call is uncommented.
Extra materials
The failing cts test is
webgpu:api,operation,buffers,map:mapAsync,read:mapAsyncRegionLeft="default-expand";mapAsyncRegionRight="default-expand"
Platform Information about your OS, version of
wgpu
, your tech stack, etc.