Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And what do you call when you call that API? wgpu in Firefox and Dawn in Chrome.

wgpu is an implementation of webgpu with the raw rust bindings rather than the C-API it also provides called by Firefox.

Unless you want to dig into the implementation details of the various subcrates.



> wgpu in Firefox

Ah, sorry, I didn't know that, thanks. On Chrome it uses either WebGL2 or WebGPU.

    When running in a web browser (by compilation to WebAssembly) without the "webgl" feature enabled, wgpu relies on the browser's own WebGPU implementation. 
https://github.com/gfx-rs/wgpu?tab=readme-ov-file#tracking-t...


The wgpu crate in rust can do two things. The first is that it is an implementation of the webgpu spec built upon OpenGL/Vulkan/DirectX/WebGL/Metal. This is what firefox uses. The other is that it can just generate calls to the webgpu api. This is what it does when targetting wasm.

So if you're writing rust with wgpu and you target wasm and run it in firefox you will have a wasm program that calls the browser's implementation of webgpu which is the same wgpu crate you used just built in the other way.

If you run it in Chrome instead it will use Dawn.

And in native land wgpu and dawn are incompatible and have different C-apis. One uses uint32_t everywhere and the other size_t. So they're the same on 32bit platforms like WASM but not on modern native platforms




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: