Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Compiler errors when building project with wgpu-rs dependency #279

Closed
rukai opened this issue Apr 25, 2020 · 4 comments · Fixed by #280
Closed

Compiler errors when building project with wgpu-rs dependency #279

rukai opened this issue Apr 25, 2020 · 4 comments · Fixed by #280
Labels
bug Something isn't working

Comments

@rukai
Copy link
Contributor

rukai commented Apr 25, 2020

I don't know what is expected of the project at the moment, but figured I would report it anyway.

You should be able to reproduce by cloning this repo and running this script:
https://github.com/rukai/brawllib_rs/blob/master/examples/run_web_visualiser.sh

image

@grovesNL
Copy link
Collaborator

For the web backend you currently need to pass RUSTFLAGS=--cfg=web_sys_unstable_apis because the WebGPU API is unstable (it's hidden behind a flag in wasm_bindgen, e.g. https://github.com/rustwasm/wasm-bindgen/blob/fc86589715996bfea5101f2b57493fb2055b0efd/crates/web-sys/src/features/gen_GpuBufferUsage.rs#L4)

@rukai
Copy link
Contributor Author

rukai commented Apr 25, 2020

@grovesNL
Copy link
Collaborator

Oh sorry, I missed that and just noticed the compiler errors complaining about missing functions.

In that case it's probably breaking because of these patches https://github.com/gfx-rs/wgpu-rs/blob/master/Cargo.toml#L75 (it looks like a slightly older version of wasm-bindgen is being used than the one we need for WebGPU).

Could you try patching wasm-bindgen in your project in the same way to use the latest master? The patches are temporary until there's a new wasm-bindgen release available.

@kvark kvark added the bug Something isn't working label Apr 25, 2020
@rukai
Copy link
Contributor Author

rukai commented Apr 25, 2020

Yes that fixes it, I made #280 to document this required workaround.

@bors bors bot closed this as completed in c0b09be Apr 25, 2020
@bors bors bot closed this as completed in #280 Apr 25, 2020
kejor pushed a commit to kejor/wgpu-rs that referenced this issue Nov 28, 2020
282: Fix dynamic stencil values r=grovesNL a=kvark

Fixes gfx-rs#279

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
kvark pushed a commit to kvark/wgpu that referenced this issue Jun 3, 2021
280: Add required wasm-bindgen patches to readme r=grovesNL a=rukai

Fixes gfx-rs/wgpu-rs#279

Co-authored-by: Rukai <rubickent@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants