Repository navigation
gpu: load optional D3D12 Agility SDK at runtime for SM 6.6+ on Windows 10 - #75
Merged
Merged
Conversation
…terface, and expand tests
This was referenced Nov 23, 2026
Merged
Collaborator
|
Merged. On Windows 11 without an Agility SDK in any of the search paths (so the inbox fallback, plus |
Lum7nt
added a commit
to Lum7nt/xcl
that referenced
this pull request
Nov 23, 2026
… and add console stubs Scarlett GDK uses subobject type 23 for Amplification Shaders (AS) and 24 for Mesh Shaders (MS), whereas PC Direct3D 12 uses slot 24 for AS and 25 for MS. Console streams passing an MS container in slot 24 previously failed pipeline stream translation as an unsupported AS, returning E_INVALIDARG. - Disambiguate slot 24 in real.rs and null.rs by checking shader container stage and NGG hardware stage. - Direct console slot 24 MS containers to mesh shader translation and fallback. - In fallback_stream, rewrite console slot 24 to PC slot 25 with dummy mesh bytecode so PC drivers accept the SM 6.5 stream. - Add unit tests for subobject payload and fallback stream rewriting. - Add console stubs for command list xcl-dev#75, xcl-dev#126, #131, xcl-dev#132, xcl-dev#142, allocator xcl-dev#9, and queue xcl-dev#31 extension.
heretic1321
pushed a commit
to heretic1321/xcl
that referenced
this pull request
Nov 23, 2026
… and add console stubs Scarlett GDK uses subobject type 23 for Amplification Shaders (AS) and 24 for Mesh Shaders (MS), whereas PC Direct3D 12 uses slot 24 for AS and 25 for MS. Console streams passing an MS container in slot 24 previously failed pipeline stream translation as an unsupported AS, returning E_INVALIDARG. - Disambiguate slot 24 in real.rs and null.rs by checking shader container stage and NGG hardware stage. - Direct console slot 24 MS containers to mesh shader translation and fallback. - In fallback_stream, rewrite console slot 24 to PC slot 25 with dummy mesh bytecode so PC drivers accept the SM 6.5 stream. - Add unit tests for subobject payload and fallback stream rewriting. - Add console stubs for command list xcl-dev#75, xcl-dev#126, #131, xcl-dev#132, xcl-dev#142, allocator xcl-dev#9, and queue xcl-dev#31 extension.
AdrianGM2001
pushed a commit
to AdrianGM2001/xcl
that referenced
this pull request
Nov 24, 2026
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.
Summary
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).