GPU: use the DirectX Agility SDK when the system D3D12 runtime refuses the shaders' root signatures #2393

Closed
github-bot wants to merge 1 commit from gh-pr/2393/head into gh-pr/2393/base
Owner

@⁠wkdwilliams on GitHub · 2026-11-25 12:39 UTC · original
wkdwilliams:gpu/agility-sdk-fallback → main · +215 −12 · 6 files · 1 commits · closed without merging

Problem

On Windows 10 (22H2, in-box d3d12.dll 10.0.19041), no host pipeline can be built. The translated shaders use root signatures with the shader model 6.6 flags CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED, and the system runtime rejects them with Unsupported bit-flag set (root signature flags c01).

translate --cache --pipelines then makes 0 pipelines (27,059 of 27,160 skipped as "the host refuses it"), and run can't create pipelines either.

Change

New victory-shader::d3d12_runtime chooses the runtime once, at first use:

  1. It serializes a probe root signature (no parameters, the two flags) on the system runtime. If that works, the system runtime is used and nothing else is loaded.
  2. If it fails and D3D12\D3D12Core.dll (Agility SDK 1.620.x, from the Microsoft.Direct3D.D3D12 NuGet package) is next to victory.exe, devices and root-signature serialization go through an ID3D12DeviceFactory for that runtime.
  3. If it fails and the DLL is missing, the system runtime stays in use and the log says what to add and where.

All host device creation and root-signature serialization now go through this module (victory-gpu host.rs and pipeline/host.rs; victory-shader emit/host.rs). The first host log line says which runtime is in use. The README gets a short Windows 10 section.

No Microsoft binary is added to the repo; the DLL is user-supplied, like the game files.

What should not change

On a runtime that accepts the flags (the Windows 11 case), the calls are the same D3D12CreateDevice and D3D12SerializeVersionedRootSignature as before. The only differences are one extra startup serialization (the probe) and one log line.

Tested

Windows 10 22H2, RTX 4060 Ti:

  • DLL present: the log says DirectX Agility SDK 620 from ...\D3D12\, and pipelines build or load from the library.
  • DLL absent: the log says what to download, and a host device is still created (no hard failure).
  • cargo clippy --workspace --all-targets is clean. cargo test --workspace --no-fail-fast: all pass except 3 victory-gpu tests (descriptor::host::tests::dynamic_slots_are_held_until_released, draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, memory::tests::lists_share_a_table_and_copies_keep_their_views). They fail identically on the base commit, so they are not from this change.

Not tested: Windows 11

The author has no Windows 11 machine. Request to a Windows 11 tester: build this branch with no D3D12 folder and check that the first victory_gpu::host log line reads Direct3D 12 runtime of Windows: the runtime in Windows accepts the root signature flags, and that behaviour is unchanged from main.

Not in scope

On this NVIDIA GPU the host view heap is capped at 1,000,000 descriptors and the title asks for more, which produces title slot past the host heap warnings and is a separate issue from this one.

**@⁠wkdwilliams** on GitHub · 2026-11-25 12:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2393) `wkdwilliams:gpu/agility-sdk-fallback` → `main` · +215 −12 · 6 files · 1 commits · closed without merging **Problem** On Windows 10 (22H2, in-box `d3d12.dll` 10.0.19041), no host pipeline can be built. The translated shaders use root signatures with the shader model 6.6 flags `CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED` and `SAMPLER_HEAP_DIRECTLY_INDEXED`, and the system runtime rejects them with `Unsupported bit-flag set (root signature flags c01)`. `translate --cache --pipelines` then makes 0 pipelines (27,059 of 27,160 skipped as "the host refuses it"), and `run` can't create pipelines either. **Change** New `victory-shader::d3d12_runtime` chooses the runtime once, at first use: 1. It serializes a probe root signature (no parameters, the two flags) on the system runtime. If that works, the system runtime is used and nothing else is loaded. 2. If it fails and `D3D12\D3D12Core.dll` (Agility SDK 1.620.x, from the `Microsoft.Direct3D.D3D12` NuGet package) is next to `victory.exe`, devices and root-signature serialization go through an `ID3D12DeviceFactory` for that runtime. 3. If it fails and the DLL is missing, the system runtime stays in use and the log says what to add and where. All host device creation and root-signature serialization now go through this module (`victory-gpu` `host.rs` and `pipeline/host.rs`; `victory-shader` `emit/host.rs`). The first host log line says which runtime is in use. The README gets a short Windows 10 section. No Microsoft binary is added to the repo; the DLL is user-supplied, like the game files. **What should not change** On a runtime that accepts the flags (the Windows 11 case), the calls are the same `D3D12CreateDevice` and `D3D12SerializeVersionedRootSignature` as before. The only differences are one extra startup serialization (the probe) and one log line. **Tested** Windows 10 22H2, RTX 4060 Ti: - DLL present: the log says `DirectX Agility SDK 620 from ...\D3D12\`, and pipelines build or load from the library. - DLL absent: the log says what to download, and a host device is still created (no hard failure). - `cargo clippy --workspace --all-targets` is clean. `cargo test --workspace --no-fail-fast`: all pass except 3 `victory-gpu` tests (`descriptor::host::tests::dynamic_slots_are_held_until_released`, `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`, `memory::tests::lists_share_a_table_and_copies_keep_their_views`). They fail identically on the base commit, so they are not from this change. **Not tested: Windows 11** The author has no Windows 11 machine. **Request to a Windows 11 tester:** build this branch with no `D3D12` folder and check that the first `victory_gpu::host` log line reads `Direct3D 12 runtime of Windows: the runtime in Windows accepts the root signature flags`, and that behaviour is unchanged from `main`. **Not in scope** On this NVIDIA GPU the host view heap is capped at 1,000,000 descriptors and the title asks for more, which produces `title slot past the host heap` warnings and is a separate issue from this one.
The translated shaders need root signatures with the shader model 6.6
directly indexed heap flags. The runtime in Windows 10 rejects them, so no
host pipeline can be made. Host devices and root signatures now go through
one module that keeps the runtime in Windows when it accepts the flags and
otherwise uses D3D12\D3D12Core.dll next to the executable, if present.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:28 +00:00
github-bot closed this pull request 2026-11-26 05:04:28 +00:00
Author
Owner

@⁠qtLkz on GitHub · 2026-11-25 12:56 UTC · original

Windows 11 check, as requested: Windows 11 Pro build 26300, RTX 4070 Ti (Ada), driver 621.01, Rust 1.98.1 pinned, this PR merged on main 940d32f, no D3D12 folder.

I don't have the game files, so I didn't run victory itself. To see the startup line, I added a throwaway local integration test (not pushed) that prints victory_shader::d3d12_runtime::description(), the string victory_gpu::host logs:

cargo test -p victory-shader --features host --locked --test runtime_probe -- --nocapture
RUNTIME: Direct3D 12 runtime of Windows: the runtime in Windows accepts the root signature flags

So on Windows 11 the probe passes on the system runtime and the Agility path isn't taken.

cargo test --workspace --locked --no-fail-fast: the same 5 failures as on plain 940d32f on this card, and nothing new:

  • victory-gpu: dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views (NVIDIA heap cap, #2317)
  • victory-shader: stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride, stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, synthetic_tests::gathers_at_a_level_match_the_hardware (fixed by #2315 + #2322)

The victory-shader hardware tests (244 passed) now serialize their root signatures through the new module, so that path is also exercised on the system runtime here.

AI-assisted (Claude).

**@⁠qtLkz** on GitHub · 2026-11-25 12:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2393#issuecomment-7163060121) Windows 11 check, as requested: Windows 11 Pro build 26300, RTX 4070 Ti (Ada), driver 621.01, Rust 1.98.1 pinned, this PR merged on main `940d32f`, **no `D3D12` folder**. I don't have the game files, so I didn't run `victory` itself. To see the startup line, I added a throwaway local integration test (not pushed) that prints `victory_shader::d3d12_runtime::description()`, the string `victory_gpu::host` logs: ``` cargo test -p victory-shader --features host --locked --test runtime_probe -- --nocapture RUNTIME: Direct3D 12 runtime of Windows: the runtime in Windows accepts the root signature flags ``` So on Windows 11 the probe passes on the system runtime and the Agility path isn't taken. `cargo test --workspace --locked --no-fail-fast`: the same 5 failures as on plain `940d32f` on this card, and nothing new: - victory-gpu: `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` (NVIDIA heap cap, #2317) - victory-shader: `stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride`, `stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `synthetic_tests::gathers_at_a_level_match_the_hardware` (fixed by #2315 + #2322) The victory-shader hardware tests (244 passed) now serialize their root signatures through the new module, so that path is also exercised on the system runtime here. AI-assisted (Claude).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2393
No description provided.