Repository navigation
Under Wine, identify the adapter from the system DXGI's ids when the driver's id query is not implemented - #252
Merged
Conversation
…driver's id query is not implemented Wine and Proton answer the driver's PCI id query (D3DKMTQueryAdapterInfo type 31) with STATUS_NOT_IMPLEMENTED, so #225's RDNA 4 check refused every board there. - Only when the query returns exactly STATUS_NOT_IMPLEMENTED and the process runs under Wine (ntdll exports wine_get_version), the system DXGI's vendor and device id of the adapter with the game device's LUID stand in, against the same vendor and RDNA 4 id list. - Any other status, a query that could not be made, the same status outside Wine, or DXGI not answering: refused as before. When the driver's ids are read, they alone decide. - One log line when the fallback accepts an adapter (the executor choice and the Ray Reconstruction runtime). - Tests with injected query results, including that the Windows path never asks the fallback's sources; the test's MSVC build uses /permissive-. Fixes #248 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 16, 2026 00:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #248
What this changes and why
Since #225, an adapter counts as RDNA 4 only if the kernel-mode driver's PCI ids say so (
D3DKMTQueryAdapterInfo, type 31), and the check fails closed. Wine and Proton don't implement that query: it answersSTATUS_NOT_IMPLEMENTED(0xC0000002), as the probe results in #248 show. So under Proton, an RX 9070 XT would get the front end's upscaler instead of WrongGPU's models.A fallback for Wine only (
clean/runtime/rdna4.h,rdna4_win.h). It applies only when both of these hold:STATUS_NOT_IMPLEMENTED;ntdllexportswine_get_version).Then the system DXGI's
VendorIdandDeviceId, for the adapter whose LUID matches the game device's, stand in for the driver's ids. They're judged by the same rule: AMD's vendor id 0x1002 and a device on the same RDNA 4 id list.Everything else fails closed as before:
STATUS_UNSUCCESSFULso it can never lead to the fallback;STATUS_NOT_IMPLEMENTEDoutside Wine;Windows behaviour is unchanged. When the driver's ids are read, they alone decide, and the fallback's sources are never asked. That holds under Wine too, if Wine implements the query later.
One log line when the fallback accepts an adapter: "Wine: the driver's adapter id query is not implemented; the adapter was identified from the system DXGI's ids (... PCI 1002:7550 (Wine: the system DXGI's ids))". The runtime writes it at the executor choice (
backend.cpp, information), and the Ray Reconstruction runtime writes it when it accepts the device. Refusals keep their current line, which now shows the ids the fallback read.All callers get it, because they share the one lookup (
read_adapter_identity): the executor choice, the native D3D12 device, and the Ray Reconstruction runtime.A limit, stated plainly: under Wine, the system DXGI is Wine's own or the one Proton ships, and its ids can be changed by that DXGI's own configuration. That is why the fallback is Wine-only and checks the same vendor and id list. The device's driver-channel probe still has to pass when the device is created (as
rdna4.hdescribes).What each new or substantially changed file is based on
Own design. No new files.
How it was tested
clean/runtime/interop/tests/test_executor_select.cpp, with injected query results (AdapterSources.driver_query,under_wine,dxgi_ids) and counts of what was asked:STATUS_NOT_IMPLEMENTED+ Wine + the system DXGI's 1002:7550: accepted, on the D3D12 executor, with the one line. Every id on the list is accepted.STATUS_NOT_IMPLEMENTED+ Wine + another vendor's ids (8086): refused, and the front end's upscaler takes the game.STATUS_NOT_IMPLEMENTED+ Wine + 10DE:7550 (an RDNA 4 device id under another vendor's id): refused.STATUS_NOT_IMPLEMENTED+ Wine + an AMD board outside the list: refused, and the line says so.STATUS_NOT_IMPLEMENTEDwithout Wine (the Windows path): refused, and the system DXGI's ids are never asked.Results:
/std:c++17 /permissive- /W4: 234 checks pass, no warnings.clean/tests/test_executor_select.pynow builds with/permissive-too; its release and developer builds pass, 10/10 tests.rdna4_win.h), run on Windows 11 with an RX 9070 XT, through a small console program that only reads adapter information:Not tested:
Checklist
Signed-off-by:line (git commit -s; Developer Certificate of Origin 1.1).REUSE.toml. (No new files.)