pixels
pixels copied to clipboard
Add a feature flag for webgl backend
Currently, if I want to use wasm-pack to build for wasm32, I have to specify
[target.'cfg(target_arch = "wasm32")'.dependencies]
wgpu = { features = ["webgl"]}
The Cargo warns that warning: dependency (wgpu) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions
To solve this problem, we should add
[features]
web = ["wgpu/webgl"]
to the Cargo.toml of this crate.
You can add a dependency on wgpu
in your crate, even if it is otherwise unreferenced. I'm not opposed to adding features, though.
A simple and safe way to do this is to add one line here:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
pollster = "0.2"
wgpu = { version = "0.12", features = ["webgl"]}
This was fixed by #320