-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Changed enumerate_adapters to be able to work with custom backends #8230
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
base: trunk
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this 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.
Discussed at the wgpu maintainers meeting. Resolution: Lets make this async and compatible with the web. Discussion
|
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
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.