Closed kvark closed 4 years ago
Steps to get this working:
#[cfg(target_arch = "wasm32")]
to target web-sys, and #[cfg(not(target_arch = "wasm32"))]
to target wgpu-native
Thank you for describing the steps! They look very actionable, and make me believe we can get a prototype running (at least device creation) by the end of the year.
FYI, (1) was mostly updated to latest WebIDL by https://phabricator.services.mozilla.com/D46166, which took more of my blood and tears than I'd hope or expect.
Edit: actually, we settled on not exporting any WebGPU logic that isn't implemented yet, other than the bare interfaces... which means that at least my https://phabricator.services.mozilla.com/D49458 needs to be merged before we proceed here.
Gecko PR has landed, and now one can at least create a device on WebGPU (in Nightly!). I think the work can be started here, according to @grovesNL plan.
I also already have some branches for web-sys changes and wgpu-rs changes for this – just need to update them based on the recent changes and then we can start making some progress here.
Small update: https://github.com/rustwasm/wasm-bindgen/pull/1997 has been merged which allows us to use web-sys bindings for WebGPU while the WebIDL is still unstable
Let's consider this fixed by #193 Amazing work of @grovesNL and everyone involved, thank you all!
We need to make wgpu-rs do the actual Web calls and run in the browser supporting WebGPU API. The API itself is still evolving, but we should start exploring what our side would look like, and maybe we'll already get something running.