4 ms·
On average, really probably not much difference. If you're talking about any game released in the last 5 years (you probably are), then WebGPU is pretty much f
by slimsag 4y ago
On average, really probably not much difference.
If you're talking about any game released in the last 5 years (you probably are), then WebGPU is pretty much fine for anything you could throw at it. Your limitation is going to be your usage of it far before any limitation of the actual API.
WebGPU as an API is basically just the union of Vulkan, Metal, and DirectX 12.
If you're using it natively (i.e. using it as a graphics abstraction on a native platform, not in a browser), it's very little overhead compared to using those other APIs directly.
Where things start to differ:
* When used in browsers, WASM->JS->C API calls have overhead. Not much, but some.
* WGSL compilers I believe aren't super optimized right now. In theory they could be almost as fast as SPIR-V -> target, but for now I think they prefer safety over speed.
* Multi-threading support: using the webgpu API across threads, as far as I know is not supported yet but would come after V1. This isn't a huge deal IMO, you can just use it in one thread dedicated to rendering.
* Hyper-modern features, like Mesh shaders (which IIRC are only available in DX12, and in Vulkan only available on Nvidia cards), or whatever Metal 3 provides.
* Ray tracing, not supported currently.
- amelius 4y agoHow about running (Py)Torch?
- slimsag 4y agoI think WebDNN[0] is working on enabling this sort of thing using WebGPU compute as a backend, but no experience with ML myself sorry. I do think WebGPU's compute API would be sufficient for ML inference, but can't say for sure. [0] https://mil-tokyo.github.io/webdnn/ https://mil-tokyo.github.io/webdnn/