Not really. You don't want to block since it might still be used in in-flight frames. You are whining about the overhead of the staging buffers, but you are fine with actually blocking the thread until the commands are finished? Lol.
That's how pretty much every game engine works. You wait for the fence that was set ~2 frames ago and then reuse the resources like buffers.
So then just do that? WebGPU allows you to wait as well(e.g. wgpuInstanceWaitAny).
The async API just makes this easier. For example, you return your staging buffers to the pool via callback when done so you just wait until the pool is not empty instead of manually juggling fences.
But just because you wait for a fence doesn't mean it's not an async operation anymore. You are just replacing Futures/Promises with fences..
View all comments
Show parent comment
6
u/Rhed0x 28d ago
That's how pretty much every game engine works. You wait for the fence that was set ~2 frames ago and then reuse the resources like buffers.