What does HackerNews think of wgpu?
Safe and portable GPU abstraction in Rust, implementing WebGPU API.
However, our renderer was built with native capabilities in mind (compute shaders!), so we would have had to rewrite it to support WebGL. We decided we'd keep up with WebGPU and see where it takes us :)
In the future, we may write a fallback renderer that's compatible with WebGL/older GPUs, but we wanted to focus on getting our existing renderer working first.
https://github.com/gfx-rs/wgpu
It is written in Rust
https://github.com/gfx-rs/wgpu
https://dawn.googlesource.com/dawn
(these are the libraries that are used in Firefox and Chrome to provide the WebGPU implementation, don't know if Apple/WebKit also has open-sourced theirs)
Some non-browser WASM runtimes also have WebGPU support already, but unfortunately only for offscreen rendering or compute tasks (e.g. for writing cross-platform windowed apps as WASM blobs, there's a window system glue layer missing).
we're talking about https://github.com/gfx-rs/wgpu which has Vulkan, Metal and DX12 backends
Conceptually it's the same as Vulkan it's just a lot less pain in the ass to work with.
Putting the UI in a canvas elements have some distinct drawbacks (https://github.com/emilk/egui/tree/master/crates/eframe#prob...) but for us it is definitely worth it. Having one unified codebase for our web app and native app, and having it all in Rust, is just amazing.
We're currently working on a 3D renderer based on wgpu (https://github.com/gfx-rs/wgpu) that we will likewise use for both web and desktop.
I don't think that is the goal for Vulkan, nor should it be. Vulkan is a low-level, high-performance API that can be used as the backend for high-level, high-performance libraries and frameworks.
> is it mature enough?
Mature enough for what? It's mature and stable enough that you can develop high-level libraries on top of it. wgpu [1], for example, has a Vulkan backend.
[1] wgpu is a WebGPU implementation; https://github.com/gfx-rs/wgpu
Maplibre-rs is something to keep an eye on, but it's very much a proof of concept and early going. It's using wgpu (https://github.com/gfx-rs/wgpu), which is a rust-based "implementation" of the WebGPU api, so to speak, which of course would support running via wasm in the browser as well as having support for pretty much all the other platforms.