mach
mach copied to clipboard
Browser support
Meta issue related to https://github.com/hexops/mach/issues/21
(moved my comment from #18 to here)
@slimsag I think it's promising not just for games but for cross-platform graphics of every kind. 👍🏽
Re: "Browser implementation of gpu.Interface", I am curious if you are planning to use Emscripten to build the Javascript <-> WASM glue code? I think that's the only way, currently, because in browser, only Javascript exposes the WebGPU driver.
Also it seems there is definitely interest in using WebGPU for General Purpose GPU (Compute), across native platforms, in browser, and in WASI as well. Some related links, which might provide some ideas for more bespoke things involving shader pipelines etc
- https://tvm.apache.org/2020/05/14/compiling-machine-learning-to-webassembly-and-webgpu
- https://github.com/WebAssembly/WASI/issues/285
Relevant proposal over here: https://github.com/ziglang/zig/issues/10836
@guidorice you can use freestanding wasm32 and js glue code to access all js resources in zig, no emscripten needed.
See for examples:
- https://github.com/bootradev/cupcake/
- https://github.com/masterq32/zero-graphics
Hello! May I ask what's the status of Browser support for now?
@glyh this is my top priority; before we implement it we need to make sysjs provide bindgen-like capability (https://github.com/hexops/mach/issues/691) which is what I'm working on now.
Once we have that, we should be able to auto-generate browser bindings and then Mach will work seamlessly in the browser.
As a quick and dirty solution can't we utilize emscripten/binaryen? Perhaps by generating a C file for emscripten to compile?