gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
843 stars 96 forks source link

Any way to check that a buffer is unmapped? #400

Open lisyarus opened 1 month ago

lisyarus commented 1 month ago

As I understand it, wgpuBufferGetMapState is currently not implemented. Is there any reason this functionality is unavailable, and is there any way to check if a buffer was successfully unmapped and can be used for further operations?

almarklein commented 1 month ago

In wgpu-py we don't use it, because in a wrapper its easy to keep track of the map-state yourself. I think its safe to assume that if wgpuBufferUnmap() successfully returns, all should be well.

So (speaking for myself) it's mostly not implemented due to a lack of need and time :) PR's to implement it are welcome though!

lisyarus commented 1 month ago

@almarklein Thanks for your answer! I assumed that unmapping is some kind of async operation as well, but if I can just unmap synchronously, I guess I'm fine.

I'll try to see if I can submit a PR :)