Skip to content

Conversation

timon-schelling
Copy link
Member

Temporary:

  • adapter override with env GRAPHITE_WGPU_ADAPTER (will be replaced with cli option)
  • print adapters (will be behind a --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.

event_loop.run_app(&mut app).unwrap();
}

async fn init_wgpu_context() -> WgpuContext {
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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

@Keavon Keavon changed the title Desktop: Rudimentary custom wgpu adapter selection Desktop: Add rudimentary support for custom WGPU adapter selection Sep 21, 2025
@timon-schelling timon-schelling force-pushed the desktop-rudimentary-custom-wgpu-adapter-selection branch from 85beffc to b47671a Compare September 21, 2025 17:12
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.

2 participants