Repository navigation
Win32/ARM64: let GraphicsAdapterSelectionCallback see unfiltered adapters and warn on Adreno WARP fallback - #21695
Conversation
…n ARM64 The ARM64 Adreno blocklist in AngleWin32EglDisplay removed every Adreno adapter from the list before it was handed to GraphicsAdapterSelectionCallback, so an application had no way to opt back into hardware acceleration and no indication that WARP (the Microsoft Basic Render Driver) was being forced. Stop mutating the adapter list. The blocklist now only moves the *default* selection to the first non-Adreno adapter when no callback is supplied, and logs a warning about the CPU-usage impact and the available workarounds. When a callback is present it receives the full, unfiltered adapter list and its choice is used as-is. As a side effect this also removes a latent IndexOutOfRange: the old code could empty the list when every enumerated adapter was Adreno. Refs AvaloniaUI#21689
|
You can test this PR using the following package version. |
|
Please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following: Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ), 1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, “Project” means any of the projects owned or managed by AvaloniaUI OÜ and offered under a license “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any “Submission” means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work. You represent that each of Your Submissions is entirely Your 4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant AvaloniaUI OÜ, and those who receive the Submission directly b. Patent License. You grant AvaloniaUI OÜ, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to AvaloniaUI OÜ. You agree to notify AvaloniaUI OÜ in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the Republic of Estonia, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and AvaloniaUI OÜ dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. nickna doesn't seem to be a GitHub user. |
Co-authored-by: Max Katz
|
@cla-avalonia agree |
|
You can test this PR using the following package version. |
What does the pull request do?
On Windows-on-ARM (ARM64),
AngleWin32EglDisplayapplies a blanket blocklist that removes every Adreno adapter from the DXGI adapter list before selecting a Direct3D 11 device. This PR keeps the conservative default (don't render on Adreno) but stops hiding those adapters fromWin32PlatformOptions.GraphicsAdapterSelectionCallback, and logs a warning when the blocklist forces a software fallback.Both changes were agreed to by @maxkatz6 in #21689 (comment) (the scoped-blocklist and Vulkan-by-default proposals from the issue are intentionally not included).
What is the current behavior?
On any ARM64 device, the blocklist disposes and removes all adapters whose description contains
adreno. TheGraphicsAdapterSelectionCallbackonly ever receives the already-filtered list, so an application cannot opt back into hardware acceleration on a healthy Adreno GPU. Nothing is logged, so the resulting fall back to the Microsoft Basic Render Driver (WARP) — and its CPU-usage cost — is silent.What is the updated/expected behavior with this PR?
GraphicsAdapterSelectionCallbackis supplied, it receives the full, unfiltered adapter list and its choice is used as-is. This gives applications a way to select an Adreno adapter deliberately while keeping the default ANGLE/D3D backend.Warning-level message is logged explaining the CPU impact and the available workarounds (GraphicsAdapterSelectionCallbackorWin32RenderingMode.Vulkan).How was the solution implemented (if it's not obvious)?
The adapter list is no longer mutated. The blocklist now only computes the default index (first non-Adreno adapter) and is skipped entirely when a callback is present. As a side effect this removes a latent
IndexOutOfRangeException: the previous code could empty the list when every enumerated adapter was Adreno.Checklist
Breaking changes
Behavioural change (no API change): on ARM64, a
GraphicsAdapterSelectionCallbacknow receives Adreno adapters that were previously filtered out, so any index-based logic inside a callback will see a longer list.Fixed issues
Refs #21689