Repository navigation
dxgi: IDXGIFactory6 and IDXGIFactory7 on the Vulkan factory (D3D-2) - #3259
Conversation
CreateDXGIFactory2(IID_IDXGIFactory7) and QueryInterface for IDXGIFactory6/7 failed on the layer's factory, which stopped at IDXGIFactory5. - EnumAdapterByGpuPreference returns the one Vulkan adapter at index 0 for every preference. - RegisterAdaptersChangedEvent / UnregisterAdaptersChangedEvent keep a cookie registry. The adapter list never changes, so the event is never signalled. Every return code follows the host dxgi.dll, measured on Windows 11 with an RTX 3070: - a preference outside the enum is accepted; - a null out is DXGI_ERROR_INVALID_CALL; - past the end is DXGI_ERROR_NOT_FOUND with *out cleared; - a non-adapter riid is E_NOINTERFACE; - a null event or cookie, and an event registered twice, are DXGI_ERROR_INVALID_CALL; - cookies start at 1 and are separate from the occlusion cookies; - an unknown cookie is DXGI_ERROR_NOT_FOUND. dxgi_swapchain_test checks each answer. With main's factory it fails at QueryInterface(IDXGIFactory6/7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
|
|
Tested afd0d4c on Intel UHD Graphics (Xe-LP, Tiger Lake-H iGPU, driver 101.7088) and NVIDIA RTX 3050 Laptop GPU (driver 617.42), Windows 11 Pro build 26300,
|
|
Tested afd0d4c on AMD Radeon RX 7600 (RDNA3), AMD 26.11.2 (LLPC), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8: pass.
AI-assisted (Claude Code, reviewed with Codex). No game files. |
|
Tested
Code read of AI-assisted. |
Item: D3D-2 (DXGI shim). This is the part of the #1380 rescope that no open PR covers (status). The shim table and the device-less factory are in #2098. The legacy
CreateSwapChainis in #1818.What
The layer's factory (
runtime/shims/dxgi_com.cpp) stopped atIDXGIFactory5, soCreateDXGIFactory2(IID_IDXGIFactory7)andQueryInterface(IDXGIFactory6/7)failed. It now answers up toIDXGIFactory7:EnumAdapterByGpuPreferencereturns the one Vulkan adapter at index 0 for every preference.RegisterAdaptersChangedEventandUnregisterAdaptersChangedEventkeep a cookie registry. The adapter list never changes, so the event is never signalled.The return codes come from the host
dxgi.dll, measured with a probe on Windows 11 and an RTX 3070:EnumAdapterByGpuPreferencewith a preference outside the enum (3, -1)S_OK(accepted)out = nullptrDXGI_ERROR_INVALID_CALLDXGI_ERROR_NOT_FOUND,*outclearedriidE_NOINTERFACE,*outclearedRegisterAdaptersChangedEventwith a null event or a null cookieDXGI_ERROR_INVALID_CALL(cookie untouched)DXGI_ERROR_INVALID_CALLUnregisterAdaptersChangedEventwith an unknown or already-removed cookieDXGI_ERROR_NOT_FOUNDdocs/d3d12_vulkan.md(DXGI swapchain paragraph) records the same answers.Tested (Windows 11, RTX 3070, NVIDIA 32.0.16.1088, VS 18, Vulkan SDK 1.4.363.1)
dxgi_swapchain_testchecks every row above. It passes with and withoutLEONIDA_VK_VALIDATION=1(0 validation errors).main'sdxgi_com.cppand the new test, it fails withQueryInterface(IDXGIFactory6/7) failed.ctest: 121/121 pass (gameinputis disabled, as onmain).Overlap: #2976, #2974, #2876, #2822 and #2808 touch other methods of the same file (
Adapter,SwapChain,MakeWindowAssociation). This PR only adds toFactory, so a rebase should be mechanical. #2098'sGetParentchange sits next to it but doesn't conflict.AI-assisted (Claude Code).
🤖 Generated with Claude Code