Repository navigation
d3d12, dxgi: isolate shims from host System32 and expose Vulkan entry points - #2098
SHAURYASANYAL3 wants to merge 2 commits into
Conversation
|
Tested AI-assisted (Claude Code). |
|
Thanks @airp1ane for testing on Windows 11 with the RTX 4060 Ti (Ada) and confirming 110 tests pass with no regressions against the baseline! |
|
Tested Windows 10 22H2, MSVC 19.44, Vulkan SDK 1.4.363.0,
What it doesn't cover: the System32 isolation only through these tests; no real executable loaded. One thing about the description: it says "Resolves #1902". #1902 was a coordination thread (the current one is #2078), so merging this would close it. If that's not intended, maybe change it to "Refs". No game files. AI-assisted (Claude Code). |
|
Thanks @nonverifiedperson for the detailed multi-GPU verification across the Ryzen 7 9800X3D RDNA2 iGPU and NVIDIA RTX 5070 Ti, and for confirming zero regressions against the merge base! Updated the PR description to replace 'Resolves' with 'Refs #1902 (RT-128)' so GitHub doesn't trigger an unintentional thread close. |
|
Tested
AI-assisted (Claude Code). |
|
Tested 8723881 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, fresh RelWithDebInfo build. It conflicts with current
One new MSVC warning: C4456 at AI-assisted (Claude Code). |
8723881 to
3651d53
Compare
|
Thanks @Jadiac5 and @JRamos1993 for testing on the AMD Radeon RX 9070 XT (RDNA4) and NVIDIA RTX 5090! Updated and pushed:
|
3651d53 to
45dfad9
Compare
45dfad9 to
cae89e8
Compare
|
Tested cae89e8 on RTX 5090, 621.24, Windows 11: pass on the tests that touch this. Built I do not see a test that specifically asserts the System32 isolation (the target list has no dedicated one), so this confirms the shims still work but not that a host DLL cannot be picked up. If that half is what the PR is for, it deserves its own test — otherwise a later regression would only show as a wrong DLL at runtime. |
|
Tested cae89e8 on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main 4c52ce2.
|
|
I reproduced a first-frame issue on cae89e8 with Windows 11, RTX 2060 driver 616.64 and Khronos validation. The loader and dxgi_swapchain CTests passed. A synthetic guest calls imported CreateDXGIFactory2 first, then creates an Xbox device and passes its direct queue to CreateSwapChainForHwnd. The factory resolves to gta6rt and both swapchain creation and GetBuffer return S_OK. CreateRenderTargetView reports resource from another device and command-list Close returns E_INVALIDARG. In the full draw test Present still returned S_OK and rotated the buffer, while ExecuteCommandLists reported that nothing was submitted and the readback pixels were wrong. On main af70fc7, obtaining the Vulkan factory from the Xbox device's DXGI adapter works through gta6rt for both HWND and synthetic CoreWindow. All 2,048 backbuffer pixels matched before Present. The exported factory creates a standalone Vulkan device, while the supplied queue belongs to the guest device. The swapchain appears to allocate its backbuffers using the factory's context. Small source-only reproducer. AI-assisted testing. |
Refs #1902 (DXGI and D3D12 Shim Isolation, RT-128)
Related to #1745, #2078, #2300
Summary
Per docs/d3d12_vulkan.md §3.1:
untime/src/pe_loader.cpp, both
esolve() and
esolve_forwarder() check !shims::owns_dll(key) before attempting LoadLibraryExA(..., LOAD_LIBRARY_SEARCH_SYSTEM32). Unshimmed or unknown exports from owned DLLs bind to
t::Binding::Unimplemented instead of leaking into host Windows C:\Windows\System32.
untime/shims/dxgi.cpp exporting CreateDXGIFactory, CreateDXGIFactory1, CreateDXGIFactory2, DXGIDeclareAdapterRemovalSupport, and DXGIGetDebugInterface1.
untime/shims/d3d12_vulkan_device.cpp, create_dxgi_factory lazily instantiates the standalone Vulkan device when called with a
ullptr device parameter.
untime/shims/d3d12_xs.cpp, added exports for d3d12.dll and d3d12_xs.dll entry points: D3D12CreateDevice, D3D12CreateVersionedRootSignatureDeserializer, D3D12GetDebugInterface, and D3D12EnableExperimentalFeatures.
untime/test/loader_test.cpp, added est_dxgi_d3d12_isolation() testing
t::shims::owns_dll for dxgi.dll and d3d12.dll, verifying that direct and forwarded imports bind to Binding::Shim, and verifying that unimplemented imports bind to Binding::Unimplemented without host leakage.
untime/test/dxgi_swapchain_test.cpp, added assertions for
t::shims::owns_dll, DXGIDeclareAdapterRemovalSupport, CreateDXGIFactory2 null argument validation (DXGI_ERROR_INVALID_CALL), and IDXGIFactory::GetParent.