-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Emscripten compatibility #641
Comments
Besides those, I just ran into few minor WebGL compatibility things.
|
Thanks @AerialX ! We\ll work on it. |
@kvark Here's a few more...
|
@AerialX Thanks for the update, this is awesome! |
Relevant update on Rust's Emscripten support in general: https://users.rust-lang.org/t/compiling-to-the-web-with-rust-and-emscripten/7627 |
Since quite some time has passed since the last comment in this issue, I was wondering what is the current situation regarding Emscripten support? Even though it looks like WebGPU is on the horizon, it probably still requires quite some time to be actually ready. It would be awesome to be able to run |
I took a bite at Emscripten+WASM the other day - https://github.com/kvark/wasm-triangle
We are working within the WebGPU W3C group, and we have a Servo-based prototype. |
1681: [pre-ll] Emscripten support with WebGL 2.0 r=msiglreith a=kvark Fixes #641. It has more things, so we'll create extra issues as we go forward. The support is limited, but it works. Unexpected limitations: `constant_buffer_supported` and `clear_buffer_supported` have to be OFF. Emscripten doesn't hook those GL functions, even though they are technically a part of GLES 3.0 standard. Also, the `glutin` dependency is switched to GitHub until the next version is published.  ## Status of the examples - `triangle` works 🎉 - `flowmap` and `blend` produce ICE in the [fastcomp](https://github.com/kripken/emscripten-fastcomp) code - `instancing` fails because it wants to map a buffer - `mipmap`, `gamma`, and `performance` I haven't tried - others use constant buffers, which are not yet supported (see above) ## How to run and test yourself You'll need Rust-1.22 or newer as well as Emscripten SDK installed. In Emscripten configuration, set `USE_WEBGL2=1`. I did it by just modifying "emscripten/src/settings.js" directly (from where it's installed). Hopefully, we'll be able to pass the linker parameters to `emcc` via `cargo` one day. ```bash rustup target add wasm32-unknown-emscripten cargo build --example triangle --feature wasm32-unknown-emscripten ls target/wasm32-unknown-emscripten/debug/examples # find the "example-XXX" name edit emscripten.html # put the example name in firefox emscripten.html # open in the browser ```
triaged: leaving open in case someone gets motivated enough to polish the support and get more examples running |
The |
641: Add optional SPIR-V shader validation r=kvark a=GabrielMajeri This PR adds some basic validation for SPIR-V shaders when creating pipelines. Starts work towards gfx-rs#269. Currently, I'm marking this as a draft because `naga` isn't mature enough to be able to parse shaders from the `wgpu-rs` examples. For example: - Trying to run `hello-triangle` from `wgpu-rs` results in the following error: `Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, Variable)` - For `hello-compute` it is: `Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)` Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
The way is clear now: http://bl.ocks.org/AerialX/26f81381b0b47c506959
The text was updated successfully, but these errors were encountered: