Skip to content

Fix assorted issues with WebGL #7448

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

Merged

Conversation

cwfitzgerald
Copy link
Member

@cwfitzgerald cwfitzgerald commented Mar 28, 2025

Connections

Fixes #7363

Description

Fixes various small issues with the wasm examples. Each commit is standalone and self-explainatory

Testing

Manually

Squash or Rebase?

Squash

Checklist

  • Run cargo fmt.

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner March 28, 2025 19:49
@cwfitzgerald cwfitzgerald changed the title Fix validation error when configuring the surface on WebGL Fix assorted issues with WebGL Mar 28, 2025
@cwfitzgerald cwfitzgerald requested review from Copilot and a team and removed request for a team March 28, 2025 19:50
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes assorted issues affecting WebGL support in the wasm examples, addressing build command consistency, dependency configuration, and error handling for wasm32 targets.

  • Updated cargo build commands in the xtask runner to use package flags instead of binary flags.
  • Expanded dependency lists for the "noop" feature and adjusted workspace dependency definitions.
  • Modified error handling in wgpu-core for wasm32 to ignore timeouts.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
xtask/src/run_wasm.rs Changed cargo build commands to use package flag (“-p”) instead of binary (“--bin”).
wgpu/Cargo.toml Added dependencies to "noop" feature for consistency with other backends.
wgpu-core/src/device/global.rs Added a wasm32-specific branch for ignoring WaitIdleError::Timeout.
examples/features/Cargo.toml Adjusted workspace dependencies for wgpu across target configurations.
Cargo.toml Removed the "webgl" feature from the wgpu dependency list.
Comments suppressed due to low confidence (2)

xtask/src/run_wasm.rs:35

  • Using the '-p' flag instead of '--bin' changes which artifact is built; please verify that this aligns with the intended build target and doesn't affect other build scenarios.
cargo build --target wasm32-unknown-unknown -p wgpu-examples --no-default-features --features webgpu {release_flag...}

Cargo.toml:70

  • Removal of the 'webgl' feature from the wgpu dependency list should be reviewed carefully to ensure it doesn't break setups that depend on explicit webgl support.
"webgl",

Copy link
Member

@ErichDonGubler ErichDonGubler left a comment

Choose a reason for hiding this comment

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

:lezduit:

@ErichDonGubler ErichDonGubler merged commit a9279de into gfx-rs:trunk Apr 1, 2025
37 checks passed
@cwfitzgerald cwfitzgerald deleted the cw/fix-surface-wait-error-webgl branch April 1, 2025 02:17
Vecvec pushed a commit to Vecvec/wgpu that referenced this pull request Apr 11, 2025
* Fix validation error when configuring the surface on WebGL

* Remove unneeded `webgl` feature

* Fix compilation of the `noop` backend on `wasm32`

* Prevent `webgpu` examples from incorrectly falling back to WebGL

* Reduce dependency set when building wasm examples

* Fix various warnings
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.

wgpu.rs/examples is broken on WebGL on Firefox
2 participants