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

changed websys features in core and hal to align with used features #2922

Merged
merged 3 commits into from
Aug 1, 2022

Conversation

Seamooo
Copy link
Contributor

@Seamooo Seamooo commented Jul 30, 2022

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
addresses #2894

Description
if using wgpu-core or wgpu-hal as a dependency with target wasm32-unknown-unknown without specifying the web-sys feature: OffscreenCanvas in the dependencies, both wgpu-core and wgpu-hal would fail to compile (wgpu-hal only when using the gles feature which is effectively implied by the target). The trivial fix to this is adding OffscreenCanvas to the web-sys features in wgpu-hal, as wgpu-core also depends on it whenever needing to use web-sys, however, for semantics sake, the feature is in use in wgpu-core as well, so has been added, however behind a more restrictive target as that's the only time web-sys is in use.

Testing
inside wgpu/wgpu-core:

  • cargo build --target wasm32-unknown-unknown
  • cargo build --target wasm32-unknown-emscripten

inside wgpu/wgpu-hal

  • cargo build --target wasm32-unknown-unknown --features gles
  • cargo build --target wasm32-unknown-emscripten --features emscripten

all builds succeed, whereas previously the wasm32-unknown-unknown target builds would fail

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants