Skip to content

Fix adapter forcing breaking wasm builds #20054

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
merged 6 commits into from
Jul 11, 2025

Conversation

atlv24
Copy link
Contributor

@atlv24 atlv24 commented Jul 9, 2025

Objective

Solution

  • Gate out enumerate_adapters usage on wasm and warn if WGPU_FORCE_FALLBACK_ADAPTER is somehow used.

@atlv24 atlv24 added this to the 0.17 milestone Jul 9, 2025
Copy link
Contributor

@superdump superdump left a comment

Choose a reason for hiding this comment

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

The only thing I’m not sure about is whether I prefer let selected_adapter = if cfg!(wasm) {} else {}; or this uninitialised variable declaration. But I don’t feel at all strongly about it given the compile time checking, so approving.

@atlv24
Copy link
Contributor Author

atlv24 commented Jul 9, 2025

The only thing I’m not sure about is whether I prefer let selected_adapter = if cfg!(wasm) {} else {}; or this uninitialised variable declaration. But I don’t feel at all strongly about it given the compile time checking, so approving.

I tried that, the issue is that if cfg!(wasm) still "name resolves" both branches afaict. So it would still be referencing the not allowed function, as its equivalent to if false {} else {}

@atlv24 atlv24 added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 9, 2025
@atlv24 atlv24 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 11, 2025
@superdump superdump added this pull request to the merge queue Jul 11, 2025
Merged via the queue into bevyengine:main with commit b3032e0 Jul 11, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants