-
-
Notifications
You must be signed in to change notification settings - Fork 905
Desktop: Add rudimentary support for custom WGPU adapter selection #3201
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: master
Are you sure you want to change the base?
Desktop: Add rudimentary support for custom WGPU adapter selection #3201
Conversation
desktop/src/main.rs
Outdated
event_loop.run_app(&mut app).unwrap(); | ||
} | ||
|
||
async fn init_wgpu_context() -> WgpuContext { |
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 don't think this is the right place to put this function. I'd generall prefer if the reusable logic was moved directly into the wgpu executor (e.g. such that it can also be used by the graphene cli etc.) and for the desktop specific parts I'd like to move those to a different file in order to not clutter up the main.rs
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.
Forgot about graphene cli, sure. Are we sure we want the exact same adapter selection code for both? what would you like the adapters to be addressed by? Is the index (that is stable for a specific system/hardware configuration), I also thought about hashing the adapters info and using 4 bytes as a id. I will implement the printing as fmt then.
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 would expose multiple function with different levels of granularity. We could have one function which does everything automagically, one which allows you to request the graphics api and one which gives you full manual control over the adapter selection. But I'd like to avoid constructign the context outside of the wgpu executor crate in case we in the future need to enable extra extensions etc. It would be a nightmare if we had to keep those in sync
85beffc
to
b47671a
Compare
988d1fc
to
256ea11
Compare
Temporary:
GRAPHITE_WGPU_ADAPTER
(will be replaced with cli option)--help
like cli flag in the future)Also selects the first DX12 adapter on windows, usually (but not in the spec) dedicated gpu > integrated gpu > software.