GPU: load optional D3D12 Agility SDK at runtime for Windows 10 SM 6.6 #12
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12"
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?
Imported from DexNom/VIctory. Originally posted by molodayamama on 2026-11-25T17:53:23Z.
Summary
Adds optional runtime loading of the Microsoft DirectX 12 Agility SDK (
D3D12Core.dll) throughID3D12SDKConfiguration1::CreateDeviceFactory, enabling Shader Model 6.6 and directly indexed descriptor heaps on Windows 10 (build 19041+) without embeddingD3D12SDKVersion/D3D12SDKPathexports or shipping any binary files in the repository.When no Agility SDK is configured or present beside the executable, behavior is unchanged and the system
d3d12.dllis used as before.Changes
crates/victory-shader/src/emit/agility.rs(classified inOUTSIDE_TRANSLATIONinlib.rsso cached shader translations are not invalidated):D3D12Core.dllfromVICTORY_D3D12_AGILITY(direct DLL path, containing folder,D3D12\subfolder, or unpackedMicrosoft.Direct3D.D3D12NuGet root) or fromD3D12\D3D12Core.dllbeside the executable.D3D12SDKVersionu32directly from the PE/PE32+ export table without loading or executing the DLL.ID3D12SDKConfiguration1::CreateDeviceFactoryand creates a process-wideID3D12DeviceFactory(D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE,ApplyToGlobalState, andGetConfigurationInterfacefor Debug Layer / DRED).serialize_versioned_root_signature, routing serialization throughID3D12DeviceConfiguration::SerializeVersionedRootSignaturewhen supported by the device so SM 6.6CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXEDroot signatures succeed on Windows 10.crates/victory-shader/src/emit/host.rs: Usesagility::load()andagility::serialize_versioned_root_signaturewhen creating shader test devices and root signatures.crates/victory-gpu/Cargo.toml,src/host.rs,src/pipeline/host.rs: Enablesvictory-shader/hoston Windows (no new crates,Cargo.lockunchanged), uses the Agility SDK factory for device/debug/DRED creation with a clean fallback to systemd3d12.dllif unavailable, and serializes root signatures viaserialize_versioned_root_signature.README.md: Documents the opt-in Windows 10 Agility SDK setup (D3D12\D3D12Core.dllorVICTORY_D3D12_AGILITY).Testing
Tested on Windows 10 22H2 (build 19045.5794, in-box
d3d12.dllcapped at SM 6.5) with an NVIDIA GeForce RTX 4060 and Microsoft DirectX 12 Agility SDK1.614.1(D3D12SDKVersion = 614, placed outside the repository):cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)cargo test --locked -p xtask: 4 passed, 0 failed (repository_passes_policypassed)cargo test --locked -p victory-shader --lib emit::agility(withoutVICTORY_D3D12_AGILITYand withVICTORY_D3D12_AGILITY): 4 passed, 0 failed in both modescargo test --locked -p victory-gpu --libwithVICTORY_D3D12_AGILITY: 188 passed, 0 failed (previously failedpipeline::host::tests::depth_bounds_pipeline_loads_and_filters_drawswithE_INVALIDARGon in-boxD3D12SerializeVersionedRootSignature)cargo test --locked -p victory-shader --libwithVICTORY_D3D12_AGILITY: all 24 previously failing SM 6.6 hardware GPU tests (32/64-bit BVH intersection, VALU, waterfall, wave64-on-wave32) passed on hardware (3 unrelated failures remain on this box: 2 pre-existingdxil.dllPSV0 rejections from Windows SDK10.0.22621.0, and 1 WARP-only test because Windows 10's in-box WARP stays at SM 6.2).git diff --check: clean. In-game gameplay was not tested (no local game files on this machine).Imported from DexNom/VIctory. Originally posted by Artking175 on 2026-11-25T18:48:47Z.
Independently verified exact head
999fd75on Windows 10 22H2 (19045), RTX 2060 (NVIDIA 531.41), and Rust 1.98.1 MSVC. I used the Microsoft Agility SDK 1.614.1 throughVICTORY_D3D12_AGILITYin a separate checkout with no executable exports or system changes.cargo test --locked -p victory-shader --lib emit::agility -- --nocapture --test-threads=1passed all four tests both with the setting unset and with it set. With the SDK set, the live test confirmed SM 6.6 and heap-indexed root signature creation.depth_bounds_pipeline_loads_and_filters_drawstest executable reproduced0x80070057with the setting unset, then passed with Agility configured.cargo test --locked -p victory-gpu --lib -- --test-threads=1with Agility configured gave 188 passed, zero failed, and three ignored.I did not run the game on this head.
Imported from DexNom/VIctory. Originally posted by HAL9000RELOADED on 2026-11-25T22:53:20Z.
First Windows 10 + Radeon run of
999fd75: RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045.6456), Agility SDK 1.620.2 throughVICTORY_D3D12_AGILITY. Base: main2e01ab4.victory-gpu: 188 passed, 0 failed.depth_bounds_pipeline_loads_and_filters_drawspasses too.victory-shader: 240 passed, 1 failed. On main without the PR, 26 shader tests fail here (SM 6.5). The newemit::agilitytests pass.warp_ray_probe_distinguishes_active_visits_and_finite_triangle_candidates: "WARP is required to validate the probe: the device supports SM 0x62 only". It fails on main too. Its WARP device stays on SM 6.2 with the factory. On this machine the system WARP does reach SM 6.6 when the executable exportsD3D12SDKVersion(another fork's #44), so maybe that test makes its WARP device outside the factory. I haven't checked.Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-26T23:12:39Z.
Native Windows 11 / RTX 5070 check at
999fd75: five isolated processes each passed the four Agility tests. With Microsoft-signed NuGet 1.614.1 configured by package root, folder, and DLL path, the factory reported requested SDK 614 and a physical SM 6.6 root signature succeeded; however, the module actually mapped in all three processes wasSystem32/D3D12Core.dll, SDK 616. With signed NuGet 1.620.2 configured, the process mapped the provided NuGet DLL (SDK 620), and root signature creation also succeeded. With no configured SDK, no optional factory was reported.This suggests the README statement that Windows 11 keeps the system runtime unchanged needs qualification for an explicitly configured newer SDK, and a log of the requested core/version does not necessarily identify the module actually loaded. I did not test Windows 10 or gameplay.
Verification was AI-assisted with GPT-6.2 Astra.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.