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

Add utils for WebGPU support detection & Instance creation #6371

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Oct 5, 2024

Connections

Description
Targeting both WebGPU & WebGL at the same time works but is a pain right now. These new utilities and doc lines should make this a lot easier!

Would be nice to make use of this in the official examples, but don't quite know yet how - the examples on web today are geared towards explicit selection.

Testing

Testing done via https://github.com/Wumpf/minifb_wgpu_web_and_desktop/tree/better-webgpu-selection

  • test on native (should no-op)
  • test browser without navigator.gpu
  • test browser with navigator.gpu no actual webgpu support (Chrome on Linux!)
  • test on browser with webgpu support

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Wumpf added 2 commits October 5, 2024 13:11
Clarifies the docs on `wgpu::Instance` accordingly
@Wumpf Wumpf force-pushed the better-webgpu-selection2 branch from 9216f22 to b77c64f Compare October 5, 2024 11:11
@Wumpf
Copy link
Member Author

Wumpf commented Oct 6, 2024

@rukai can you check if this solves the problem for you? I don't have a good repro setup for it right now
Either by using the new new_instance_with_webgpu_detection method yourself or by checking with running cargo xtask run-wasm on https://github.com/Wumpf/minifb_wgpu_web_and_desktop/tree/better-webgpu-selection
Thank you!

@Wumpf Wumpf marked this pull request as ready for review October 13, 2024 10:45
@Wumpf Wumpf requested a review from a team as a code owner October 13, 2024 10:45
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Much clearer than before!

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
@Wumpf
Copy link
Member Author

Wumpf commented Oct 14, 2024

Let's hold off with merging: Tried to test this myself now in Chromium on Wsl which seems to exhibit the issue, but I wasn't able to demonstrate it being fixed with using the new utility here

@Wumpf
Copy link
Member Author

Wumpf commented Oct 14, 2024

phew! Figured it out quite quickly, bfd7879 fixes it. Very happy I checked

@Wumpf Wumpf merged commit 59f56e0 into gfx-rs:trunk Oct 15, 2024
27 checks passed
@Wumpf Wumpf deleted the better-webgpu-selection2 branch October 15, 2024 11:15
@rukai
Copy link
Contributor

rukai commented Dec 22, 2024

I can confirm this successfully fixes webgl fallback on linux+chrome.
Thankyou so much for this.

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.

webgl fallback fails in some browsers.
3 participants