wgpu_glyph icon indicating copy to clipboard operation
wgpu_glyph copied to clipboard

Wasm support?

Open smolck opened this issue 3 years ago • 3 comments

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!

smolck avatar Mar 06 '21 19:03 smolck

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: https://github.com/hecrj/wgpu_glyph/pull/62 and change wgpu to add the feature 'webgl', but not at a computer that can test that atm

Dispersia avatar Apr 11 '21 22:04 Dispersia

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

See https://github.com/hecrj/wgpu_glyph/pull/55#issuecomment-795682366; 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.

smolck avatar Apr 11 '21 22:04 smolck

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!

bionic-hillbilly avatar Apr 19 '21 11:04 bionic-hillbilly