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

Added Win32PlatformOptions.GraphicsAdapterSelectionCallback #17079

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kekekeks
Copy link
Member

This adds a way to control the graphics adapter chosen by Avalonia from user code.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051993-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Sep 23, 2024
Merged via the queue into master with commit 49ab0b3 Sep 23, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the feature/d3d-adapter-selection-callback branch September 23, 2024 23:03
@llfab
Copy link

llfab commented Sep 24, 2024

I tested this on Windows 10 and 11 with both Optimus setup on laptops and GPU offload function on desktops. All with both integrated Intel GPU and discrete Nvidia GPU. Tests shoe that you can select e.g. Nvidia GPU even if your one and only screen is connected to the integrated Intel GPU, hence, your UI App would "naturally" be running on the Intel GPU.

With this change you can modify the default GPU. The Avalonia UI App will then be driven by the Nvidia GPU which even works correctly with the "Shared GPU memory" API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants