gpu: load optional D3D12 Agility SDK at runtime for SM 6.6+ on Windows 10 #75
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!75
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/75/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@certified-retart on GitHub · 2026-11-23 01:14 UTC · original
certified-retart:feat/d3d12-agility-sdk→main· +751 −50 · 10 files · 2 commits · merged 2026-11-23 10:29 UTCSummary
Adds optional run-time DirectX 12 Agility SDK loading (
ID3D12SDKConfiguration1::CreateDeviceFactory) so Windows 10 22H2 (build 19045.3393+, KB5029331) machines can run Shader Model 6.6+ GPU tests and titles without Developer Mode or staticD3D12SDKVersion/D3D12SDKPathexports.Windows 10's inbox
System32\D3D12Core.dllstops at SM 6.5 even on modern GPUs and drivers (such as RTX 5070 and RDNA 2/3 iGPUs), causing every SM 6.6+ GPU test inxclto skip on Windows 10.What changed
gpu::agilityloader (+ 6 unit tests inagility_tests.rs):%XCL_D3D12_DIR%(exclusive when set),<exe_dir>\D3D12,<exe_dir>, and%LOCALAPPDATA%\XCL\D3D12forD3D12Core.dll.D3D12SDKVersiondirectly fromD3D12Core.dll's PE exports on disk without loading or executing the DLL (rejecting non-DLLs, forwarders, zero versions, and malformed export/section bounds).GetACP()), respecting theWideCharToMultiBytecontract for bothCP_UTF8(65001) / GB18030 (54936) and legacy ANSI code pages.ID3D12DeviceFactoryonce viaID3D12SDKConfiguration1::CreateDeviceFactory, setsALLOW_RETURNING_EXISTING_DEVICE, and applies it to global state once before any XCL device exists (so globalD3D12SerializeVersionedRootSignatureaccepts SM 6.6 directly-indexed heap flags). Falls back transparently to inboxD3D12CreateDevicewhen no Agility SDK is present or the OS lacksID3D12SDKConfiguration1.configuration_interface(ID3D12Debug, DRED) throughfactory.GetConfigurationInterfacewhen loaded (without falling back to inbox globalD3D12GetDebugInterface).gpu::recomp::runner,hle::d3d12x::real, and test helpers ingpu::texture/hle::mfplat) throughgpu::agility::create_device.hle::d3d12x::real&list_x):CloseandReset. Without re-adopting the new state vtable,e2efailed onKickoffX/CopyBufferRegion(0xc0000005).real::preserve_vtable(re-adopting the runtime's new native table under the sameKindvia theCLASSEScache so subsequent calls dispatch through the current native state table) acrosscl_close,cl_reset,kickoff_x,reset_x, anddma_close_x.pe.rs):Pe::exportsandExports::is_forwarder_rva, clamped data directories toSizeOfOptionalHeader, and boundedLayout::FileRVA reads (bytes_at,u16_at,u32_at,u64_at,cstr_at) to their containing section/header raw slice.README.md): DocumentedXCL_D3D12_DIRand the default Agility SDK search paths for Windows 10.Verification
Tested on Windows 10 Pro (
10.0.19045.5794, inboxD3D12Core.dll= SM 6.5 max) with Microsoft DirectX 12 Agility SDK1.620.2(D3D12SDKVersion = 620):no SM 6.6);e2ecrashed on Agility SDK1.620.2beforepreserve_vtable.XCL_D3D12_DIR=<agility>,XCL_ADAPTER=1AMD Radeon iGPU,XCL_REQUIRE_GPU=wave64,mesh):cargo test --workspace -- --test-threads=2: 378 passed, 0 failed, 34 ignored, 0 GPU skips (xcl --lib: 349 passed,e2e: 2 passed,console_dlls_e2e: 12 passed,gpu_pso_e2e: 6 passed,console_shaders: 3 passed,xg_oracle: 3 passed,rpf_e2e: 2 passed,disasm_e2e: 1 passed).XCL_D3D12_DIR=<agility>,XCL_ADAPTER=0NVIDIA GeForce RTX 5070):cargo test -p xcl --test e2e: 2 passed, 0 failed.XCL_D3D12_DIRunset):cargo test -p xcl --test e2e: 2 passed, 0 failed.cargo test -p xcl --lib agility(6 passed) andpe::(3 passed).mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@ivall on GitHub · 2026-11-23 10:29 UTC · original
Merged. On Windows 11 without an Agility SDK in any of the search paths (so the inbox fallback, plus
preserve_vtableand the new PC-listResetoverride) everything above still holds – XDefiant's copy-list resets included. I have no Windows 10 box to check the Agility path itself; your numbers in the description cover that. Tested on Windows 11 with an RX 9070 (RDNA4):cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), also withXCL_SPLIT_WAVE64=1(the 32-lane split path forced on RDNA). Unicorn Overlord and XDefiant run with this round merged. Thanks!mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175