-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM crashes #276
Comments
That particular error message makes it look like it's getting |
The WASM crash is due to a known issue in wgpu which should get fixed by gfx-rs/wgpu#3428. |
Vello is (carefully) designed to work with |
@raphlinus my code not working was a red herring, the issue may be in yours/wgpu... I noticed the same issue pops up in Vello's run_wasm, after updating wgpu to 0.15.1. If I use And if I use |
In the case of with_bevy, it could be related to the |
Ah yes, it definitely won't work with a GL backend. Perhaps the error messages could be improved in this case. Do the WebGPU samples work for you? |
Those samples work on canary! Huzaahh. I was using the https://wgpu.rs/examples-gpu/ and wondering why I couldn't see anything despite having all of the flags... So apparently the What about the Compute pipeline? I'm wondering if that's an issue from Bevy, since neither mine or yours works with bevy :) Is cargo run_wasm supposed to work |
The relevant line is: That is, you cannot use the top-level The only evidence from the bevy side of WebGPU support is this comment from @mockersf. That seems a bit backwards to me at this point where WebGPU is imminent-ish. If WebGPU turned out to be insufficient for bevy's needs, it seems better to find that out before it was stable in Firefox and Chrome, for example. |
I see. So maybe we push some documentation at the least saying Vello cannot run with Bevy for a while. I'll go ahead and clean this issue up. |
hey, sorry for gravedigging but I'm running |
gfx-rs/wgpu#3428 has been merged and bumping vello's dependency on wgpu to |
gfx-rs/wgpu#3430 tracks the It looks like we also have a separate regression on the vello side following #273 which causes the WASM module to not execute the
|
Fixed the WASM crashes by reverting to wgpu = 0.14. This surfaced two more bugs in the repo for which I included fixes. A big issue is wasm32-unknown-unknown does not support std::time::Instant, so I implemented a polyfill based on rust-lang/rust#48564 (comment). The animated examples, SVG loader, and the frame statistics monitor won't work in WASM without this. Once there is progress on the wgpu end, I'll turn that into a proper PR.
Fixed the WASM crashes by reverting to wgpu = 0.14. This surfaced two more bugs in the repo for which I included fixes. A big issue is wasm32-unknown-unknown does not support std::time::Instant, so I implemented a polyfill based on rust-lang/rust#48564 (comment). The animated examples, SVG loader, and the frame statistics monitor won't work in WASM without this. Once there is progress on the wgpu end, I'll turn that into a proper PR. Other issues: * The WGSL won't compile on native since this version of wgpu/naga doesn't support `const`. Chrome Canary in WASM works though. * There are serious visual artifacts in the examples when run in the browser.
I did consider that fix, but according to the docs, https://doc.rust-lang.org/cargo/reference/manifest.html That form isn't supported; it's only allowed for dependencies. I haven't tested it though. Is there an issue on the |
I think so. Just changing the
I also tried running the example with |
Fixed the WASM crashes by reverting to wgpu = 0.14. This surfaced two more bugs in the repo for which I included fixes. A big issue is wasm32-unknown-unknown does not support std::time::Instant, so I implemented a polyfill based on rust-lang/rust#48564 (comment). The animated examples, SVG loader, and the frame statistics monitor won't work in WASM without this. Once there is progress on the wgpu end, I'll turn that into a proper PR. Other issues: * The WGSL won't compile on native since this version of wgpu/naga doesn't support `const`. Chrome Canary in WASM works though. * There are serious visual artifacts in the examples when run in the browser.
Fixed the WASM crashes by reverting to wgpu = 0.14. This surfaced two more bugs in the repo for which I included fixes. A big issue is wasm32-unknown-unknown does not support std::time::Instant, so I implemented a polyfill based on rust-lang/rust#48564 (comment). The animated examples, SVG loader, and the frame statistics monitor won't work in WASM without this. Once there is progress on the wgpu end, I'll turn that into a proper PR. Also currently need to run the example with `cargo run_wasm --package with_winit --bin with_winit_bin` Other issues: * The WGSL won't compile on native since this version of wgpu/naga doesn't support `const`. Chrome Canary in WASM works though. * There are serious visual artifacts in the examples when run in the browser.
A little lost here with the details. Why does changing the package name fix the WASM build, and what does "PDB" stand for? Thank you. Also - I don't like the idea of going back to wgpu 0.14, as I saw in your experimentation branch. Is that the intention? I would suggest keeping it broken until it's stable on 0.15 and submitting PRs to move us forwards, not backwards. |
@DJMcNab can speak to this but I believe on Windows he had to deduplicate the binary name from the package name. This affects WASM since it looks like
I agree, I don't support reverting Vello to wgpu 0.14 either. I created the dev branch as an experiment for demos in the short term. To summarize, I have identified 3 overall issues blocking WASM support:
|
Thanks for the context! regarding #3, there's a crate called |
Fix WASM build - Rolled wgpu to 0.16. - Incorprated the instant crate in lieu of std::time::Instant which works on WASM and native builds. - Fixed the issue with window scaling by setting the canvas size based on winit Window dimensions. - Fixed a division-by-zero issue in path_coarse_full This resolves #276
So I made sure I was on wgpu 15 and using the most recent version.
I cannot seem to make the run_wasm work. On the vello example, I see a problem with adapter.features() from webgpu causing a crash. Doesn't work on canary or nightly.
In my personal project I get a bug saying there's no way to allocate a storage buffer. Unrelated, but just letting you know. Perhaps this could be a 2 birds with 1 stone issue.
The text was updated successfully, but these errors were encountered: