Skip to content
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 support? #59

Open
smolck opened this issue Mar 6, 2021 · 3 comments
Open

Wasm support? #59

smolck opened this issue Mar 6, 2021 · 3 comments

Comments

@smolck
Copy link

smolck commented Mar 6, 2021

Hello! So I tried out some of the examples following the directions in wgpu-rs's wiki to compile them to wasm, but they all seemed to fail on trying to create a surface from the winit window (or various other reasons; I tried to get them to work by modifying them based on wgpu-rs's examples, but to no avail). Am I doing something wrong, or does this library not support targeting wasm? If the latter, could support for wasm be added?

Thanks!

@Dispersia
Copy link
Contributor

this library supports wasm, can you show your example code that was failing? And with creating the surface, are you using a browser that has webgpu enabled? If you don't want to use a browser with webgpu, i haven't tested it but you can try my draft pr here: #62 and change wgpu to add the feature 'webgl', but not at a computer that can test that atm

@smolck
Copy link
Author

smolck commented Apr 11, 2021

this library supports wasm, can you show your example code that was failing?

See #55 (comment); I tried running the code of that PR (following the directions mentioned in wgpu-rs's repository just adapted for this) on both Firefox Nightly and Chrome Canary to no avail. I would test it again but apparently it won't work on Firefox Nightly, and for some reason a new install of Chrome Canary is crashing for me and I'm not too bothered about figuring out why/fixing it.

I could maybe install the dev edition of Safari and try it out there if necessary, assuming Safari has all the required parts of the WebGPU spec implemented to run the example/this library, though.

@bionic-hillbilly
Copy link

Hi there,
I'm currently trying to use wgpu_glyph with wasm and it seems I'm unable to understand errors I got.
Maybe someone here could tell me what is wrong in my code.
Here is the code.

I'm testing this out with firefox 87.0 on macos with dom.webgpu.enabled set to true.

I obtain the following error:

Uncaught (in promise) RuntimeError: unreachable executed
__wbg_adapter_53 webpack:///../pkg/rust_wgpu_wasm_example_bg.js?:576
real webpack:///../pkg/rust_wgpu_wasm_example_bg.js?:525
8a9647c3616c122ecb52.module.wasm:1919121:1

Any idea ? Let me know if something I wrote in unclear.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants