Skip to content

Conversation

R-Cramer4
Copy link

@R-Cramer4 R-Cramer4 commented Sep 15, 2025

Description
When using a custom wgpu backend, you can't enumerate through the adapters to check compatibility because it checks if it is a Core Adapter. This change moves that code to the inner part of an Adapter so it can be a part of the AdapterInterface trait. This allows more functionality with custom backends.

Testing
Running all current tests

Squash
Commits will be squashed on merge

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@R-Cramer4 R-Cramer4 marked this pull request as ready for review September 15, 2025 17:04
@sagudev
Copy link
Collaborator

sagudev commented Sep 16, 2025

As I already said in on matrix, I think it would be good to export enumerate_adapters everywhere and make it return just one adapter on the web. But to make this work, we would need to make enumarate_adapters async.

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

I think biting the bullet and making enumerate_adapters async is the right call, not just because of the custom backend problem at hand but more so because it allows us to provide this also on WebGPU, elminating one of the weirder native/non-native distinctions. 👍

cc: @cwfitzgerald because this has been around for a long time and there might be repercussions I'm not thinking about right now

This being a breaking change that affects almost everyone, this should be mentioned prominently in the changelog.

@Wumpf Wumpf self-requested a review September 24, 2025 15:12
@cwfitzgerald
Copy link
Member

Discussed at the wgpu maintainers meeting. Resolution: Lets make this async and compatible with the web.

Discussion
  • CF: I have some concerns about async
  • AR: There’s already async in initialization, so this is not worse.
  • CF: We can talk about improvements to the apis in general with async.
  • TT: Doesn’t work on WebGL
    • Hasn’t changed from previous behavior but should make sure this is documented

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.

4 participants