by tkzed49 · 2y ago · 0 comments
Right now I feel like the only way to write efficient WebGPU code is to deeply understand specific GPU architectures. I hope some day there's a dev tools tab that shows me I'm spending too much time sampling a texture or there's a lot of contention on my atomic add.
> Right now I feel like the only way to write efficient WebGPU code is to deeply understand specific GPU architectures. I hope some day there's a dev tools tab that shows me I'm spending too much time sampling a texture or there's a lot of contention on my atomic add.
It's kind of the nature of the beast. Something that's cheap on one GPU might be more expensive on another, or might be fine because you can hide the latency even if it's slow, or the CPU overhead negates any GPU wins, etc. The APIs that give you the data for what you're asking are also vendor-specific.
I know that the reason is a lot of technical complexity (plus little standardization between vendors), but I think the end goal should be to make GPU programming more accessible.
Developer tooling for debugging 3D Web APIs has been a continuous request since WebGL 1.0, from 2011.
Until now the only thing that ever came out of it was SpectorJS and it shows its age.
For a while Firefox did have a debugger, that they eventually removed from developer tools.
You are left with writing the application twice, so that can make use of modern native debugging tools for graphics programming.