Windows 10: load the D3D12 Agility SDK runtime for shader model 6.6 #402

Open
domints wants to merge 12 commits from upstream-pr/402 into main
domints commented 2026-11-25 00:25:27 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by domints on 2026-11-25T00:25:27Z.


Windows 10's in-box D3D12 stops at shader model 6.5 and refuses root signatures with the directly indexed heap flags (c01), so every translated pipeline was refused and nothing drew (#84).

victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath (.\D3D12), and cargo xtask agility fetches Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, checks its published SHA-512, and puts D3D12Core.dll and d3d12SDKLayers.dll in target<profile>\D3D12. The DLLs never enter the repository. Windows 11, or a missing folder, keeps the in-box runtime.

victory config reports whether the runtime is in place, and the SM 6.5 error names the command.

This PR is just an extraction of single relevant commit from #22 which grows in more and more unrelated commits

<!-- greyfinch-sync:fxceless/victory-fork:issue:5482713587 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402). Originally posted by [domints](https://github.com/domints) on 2026-11-25T00:25:27Z. --- Windows 10's in-box D3D12 stops at shader model 6.5 and refuses root signatures with the directly indexed heap flags (c01), so every translated pipeline was refused and nothing drew (#84). victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath (.\D3D12\), and `cargo xtask agility` fetches Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, checks its published SHA-512, and puts D3D12Core.dll and d3d12SDKLayers.dll in target\<profile>\D3D12\. The DLLs never enter the repository. Windows 11, or a missing folder, keeps the in-box runtime. `victory config` reports whether the runtime is in place, and the SM 6.5 error names the command. This PR is just an extraction of single relevant commit from #22 which grows in more and more unrelated commits
HAL9000RELOADED commented 2026-11-25 13:06:06 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T13:00:34Z.


Tested on Windows 10, where this matters, with an AMD card.

Setup: Windows 10 Pro 22H2 (19045), Radeon RX 7900 XTX (RDNA3), Adrenalin 32.0.32015.7029, Rust 1.98.1, DXIL validator and PC dxc from SDK 10.0.26100.

  • Tree: this PR's head e24d4b0 merged onto main a253706 (no conflict), plus the stack-headroom test fix from Marvisak/VIctory#742.
  • No game data used.

Results

  • Before cargo xtask agility: victory-shader gives 192 passed and 23 failed. The failures are the GPU tests with "no SM 6.6 device available", the in-box behaviour, so nothing changes without the runtime. Its test executable then exports nothing (checked with dumpbin /exports).
  • cargo xtask agility: it downloaded 1.620.2 and placed it in target\{debug,release,diag}\D3D12\.
  • After it, the whole workspace: 566 passed, 1 failed. Every victory-shader GPU test ran on the hardware device; there is no "no SM 6.6 hardware device" line.

Two notes

  1. victory-gpu's tests get no exports, so they stay on the in-box runtime.
    • The one failure above is victory-gpu's depth_bounds_pipeline_loads_and_filters_draws. Its root signature is refused there with E_INVALIDARG; see #850 and #692.
    • Its mesh test skips ("no host mesh shader support; skipped").
    • With the runtime in place, the same test passes on this card.
    • victory-shader's conditional exports in build.rs could cover victory-gpu's tests the same way.
  2. victory.exe exports unconditionally (dumpbin shows both symbols). With the exports and no D3D12\D3D12Core.dll beside the executable, D3D12CreateDevice fails with 0x887E0003 (D3D12_ERROR_INVALID_REDIST) on this Windows 10. I checked that with a standalone probe. So a victory.exe built without cargo xtask agility would have no host device. This is the same note as on #69.

The runs behind this, with the three fixes that make victory-gpu's tests pass on Windows 10 (#875, #849, #692): https://github.com/fxceless/victory-fork/issues/850#issuecomment-7163161066

<!-- greyfinch-sync:fxceless/victory-fork:comment:7163162012 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7163162012). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T13:00:34Z. --- Tested on Windows 10, where this matters, with an AMD card. **Setup:** Windows 10 Pro 22H2 (19045), Radeon RX 7900 XTX (RDNA3), Adrenalin 32.0.32015.7029, Rust 1.98.1, DXIL validator and PC dxc from SDK 10.0.26100. - **Tree:** this PR's head `e24d4b0` merged onto `main` `a253706` (no conflict), plus the stack-headroom test fix from Marvisak/VIctory#742. - No game data used. **Results** - **Before `cargo xtask agility`:** victory-shader gives 192 passed and 23 failed. The failures are the GPU tests with "no SM 6.6 device available", the in-box behaviour, so nothing changes without the runtime. Its test executable then exports nothing (checked with `dumpbin /exports`). - **`cargo xtask agility`:** it downloaded 1.620.2 and placed it in `target\{debug,release,diag}\D3D12\`. - **After it, the whole workspace:** 566 passed, 1 failed. Every victory-shader GPU test ran on the hardware device; there is no "no SM 6.6 hardware device" line. **Two notes** 1. **victory-gpu's tests get no exports, so they stay on the in-box runtime.** - The one failure above is victory-gpu's `depth_bounds_pipeline_loads_and_filters_draws`. Its root signature is refused there with `E_INVALIDARG`; see #850 and #692. - Its mesh test skips ("no host mesh shader support; skipped"). - With the runtime in place, the same test passes on this card. - victory-shader's conditional exports in `build.rs` could cover victory-gpu's tests the same way. 2. **`victory.exe` exports unconditionally** (`dumpbin` shows both symbols). With the exports and no `D3D12\D3D12Core.dll` beside the executable, `D3D12CreateDevice` fails with `0x887E0003` (`D3D12_ERROR_INVALID_REDIST`) on this Windows 10. I checked that with a standalone probe. So a `victory.exe` built without `cargo xtask agility` would have no host device. This is the same note as on #69. The runs behind this, with the three fixes that make victory-gpu's tests pass on Windows 10 (#875, #849, #692): https://github.com/fxceless/victory-fork/issues/850#issuecomment-7163161066
domints commented 2026-11-25 14:10:48 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by domints on 2026-11-25T13:20:14Z.


@HAL9000RELOADED as far as I understand, Note 2 is irrelevant - it doesn't change behaviour on Windows 11, because this D3D12Core.dll in correct version is available in the OS by default, and also the whole point of this Agility fix is that Windows 10 has outdated version and it REQUIRES new version downloaded from NuGet so obviously it won't run without those DLLs downloaded.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7163629963 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7163629963). Originally posted by [domints](https://github.com/domints) on 2026-11-25T13:20:14Z. --- @HAL9000RELOADED as far as I understand, Note 2 is irrelevant - it doesn't change behaviour on Windows 11, because this D3D12Core.dll in correct version is available in the OS by default, and also the whole point of this Agility fix is that Windows 10 has outdated version and it REQUIRES new version downloaded from NuGet so obviously it won't run without those DLLs downloaded.
domints commented 2026-11-25 14:10:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by domints on 2026-11-25T13:34:21Z.


@HAL9000RELOADED Added the fix to gpu crate, also revalidated note 2, and added the condition to symbol export. Tested on my Windows 10, works properly.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7163971568 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7163971568). Originally posted by [domints](https://github.com/domints) on 2026-11-25T13:34:21Z. --- @HAL9000RELOADED Added the fix to gpu crate, also revalidated note 2, and added the condition to symbol export. Tested on my Windows 10, works properly.
HAL9000RELOADED commented 2026-11-25 14:10:53 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T14:05:37Z.


Re-tested the new head fb5da17 on Windows 10 22H2 (19045) with an RX 7900 XTX (plus the stack-headroom test fix from Marvisak/VIctory#742). No game data used.

  • Without the runtime: victory.exe and the victory-shader and victory-gpu test executables export nothing (dumpbin /exports).
  • After cargo xtask agility and a plain cargo build / cargo test --no-run, with no clean: all three export D3D12SDKVersion and D3D12SDKPath.
  • Whole workspace: 567 passed, 1 failed.
    • The failure is warp_budget_saturates…, which also fails on main (#849).
    • A second victory-gpu run hit the WARP access violation from #850 (#875).
  • victory-gpu with the runtime:
    • depth_bounds_pipeline_loads_and_filters_draws now passes; before, on the in-box runtime, it failed with E_INVALIDARG.
    • The mesh pipeline test runs instead of skipping.

Both notes are covered here. Thanks for picking them up, @domints, and for fixing them so quickly.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7164745944 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7164745944). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T14:05:37Z. --- Re-tested the new head `fb5da17` on Windows 10 22H2 (19045) with an RX 7900 XTX (plus the stack-headroom test fix from Marvisak/VIctory#742). No game data used. - **Without the runtime:** `victory.exe` and the victory-shader and victory-gpu test executables export nothing (`dumpbin /exports`). - **After `cargo xtask agility`** and a plain `cargo build` / `cargo test --no-run`, with no clean: all three export `D3D12SDKVersion` and `D3D12SDKPath`. - **Whole workspace:** 567 passed, 1 failed. - The failure is `warp_budget_saturates…`, which also fails on `main` (#849). - A second victory-gpu run hit the WARP access violation from #850 (#875). - **victory-gpu with the runtime:** - `depth_bounds_pipeline_loads_and_filters_draws` now passes; before, on the in-box runtime, it failed with `E_INVALIDARG`. - The mesh pipeline test runs instead of skipping. Both notes are covered here. Thanks for picking them up, @domints, and for fixing them so quickly.
GamingRipperDoc commented 2026-11-26 07:03:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by GamingRipperDoc on 2026-11-26T06:52:05Z.


Tested on Windows 10 22H2 (19045), AMD RX 9070 XT (Adrenalin 32.0.32015.7029), Rust 1.98.1. This PR (d95e86e) merged locally with current main (46bf535); the merge was clean.

  • cargo xtask agility: fetched Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, and put D3D12Core.dll and d3d12SDKLayers.dll in target\{debug,release,diag}\D3D12\.
  • victory config: d3d12 sdk : ...\target\release\D3D12\D3D12Core.dll (version 620).
  • cargo test -p victory-shader --lib --locked: 217 passed, 0 failed. Without a runtime on this machine, 23 of these fail for want of an SM 6.6 device.
  • cargo test -p victory-gpu --lib --locked -- --test-threads=1: 209 passed, 0 failed, depth_bounds_pipeline_loads_and_filters_draws included (it fails on Windows 10 without the runtime).
  • Game, release build, no VICTORY_* variables: pipelines are created and the title runs into its 3D frames. That needed #1213 merged as well. Without it, AMD's shader compiler crashes 4 s in at amdxc64.dll+0x861b9f, which #1213 is about. The crash comes from main's translated shaders, not from this PR: it happened at this PR's own head too, and the runtime is the same 1.620.2 as in my old runs. With #1213 (and #317, #1216, also merged for this run) it ran 3 minutes past frame 1,790 with 2,871 pipelines bound and no device removal.

So on this machine the runtime loads and is used as described.

No game data in this comment.

AI-assisted (Claude Code); I ran the checks above on my machine.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7184861980 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7184861980). Originally posted by [GamingRipperDoc](https://github.com/GamingRipperDoc) on 2026-11-26T06:52:05Z. --- Tested on Windows 10 22H2 (19045), AMD RX 9070 XT (Adrenalin 32.0.32015.7029), Rust 1.98.1. This PR (`d95e86e`) merged locally with current `main` (`46bf535`); the merge was clean. - `cargo xtask agility`: fetched Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, and put `D3D12Core.dll` and `d3d12SDKLayers.dll` in `target\{debug,release,diag}\D3D12\`. - `victory config`: `d3d12 sdk : ...\target\release\D3D12\D3D12Core.dll (version 620)`. - `cargo test -p victory-shader --lib --locked`: 217 passed, 0 failed. Without a runtime on this machine, 23 of these fail for want of an SM 6.6 device. - `cargo test -p victory-gpu --lib --locked -- --test-threads=1`: 209 passed, 0 failed, `depth_bounds_pipeline_loads_and_filters_draws` included (it fails on Windows 10 without the runtime). - Game, release build, no `VICTORY_*` variables: pipelines are created and the title runs into its 3D frames. That needed #1213 merged as well. Without it, AMD's shader compiler crashes 4 s in at `amdxc64.dll+0x861b9f`, which #1213 is about. The crash comes from `main`'s translated shaders, not from this PR: it happened at this PR's own head too, and the runtime is the same 1.620.2 as in my old runs. With #1213 (and #317, #1216, also merged for this run) it ran 3 minutes past frame 1,790 with 2,871 pipelines bound and no device removal. So on this machine the runtime loads and is used as described. No game data in this comment. AI-assisted (Claude Code); I ran the checks above on my machine.
cbw2580147369-commits commented 2026-11-28 03:11:25 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by cbw2580147369-commits on 2026-11-28T03:11:25Z.


Two notes for Windows 10 users, after the 27 November base switch.

  1. main carries no Agility exports any more. apps/victory/src/agility.rs and apps/victory/build.rs are gone from the tree based on VIctory-NVIDIA, while crates/victory-gpu/src/host.rs still sets D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED (line 1129-1130). On Windows 11 the in-box runtime takes both and answers SM 6.6, so nothing there needs a shim; on Windows 10 19045 the in-box runtime refuses them and the title never starts.

  2. The shim from the older tree still fits the new one unchanged. What I put back on 2f3f3993 (Windows 10 22H2 19045, Arc B580):

  • apps/victory/src/agility.rs:
    #[unsafe(no_mangle)] pub static D3D12SDKVersion: u32 = 620;
    #[unsafe(no_mangle)] pub static D3D12SDKPath: SdkPath = SdkPath(c".\\D3D12\\".as_ptr());
    plus runtime_dir() / runtime_present() helpers.
  • apps/victory/build.rs (MSVC only):
    cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKVersion,DATA
    cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKPath,DATA
  • apps/victory/src/main.rs: mod agility;
  • Agility 1.620.2 unpacked to D3D12\ beside victory.exe (D3D12Core.dll 4874024 B, d3d12SDKLayers.dll).

With that, cargo build --profile diag -p victory --features diagnostics produces a 15.3 MB victory.exe, both symbols show in strings, and the title runs to its menus with the full UI and into the intro on an Arc B580. Diagnostics from that run are in #1370.

If keeping the export in-tree is unwanted for Windows 11 builds, a cfg(windows) module guarded by a feature, or a cargo xtask agility that always emits the two exports, would both do; the point is that the two symbols have to be on the executable for 19045 to load D3D12\D3D12Core.dll.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7232866272 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/402#issuecomment-7232866272). Originally posted by [cbw2580147369-commits](https://github.com/cbw2580147369-commits) on 2026-11-28T03:11:25Z. --- Two notes for Windows 10 users, after the 27 November base switch. 1. **main carries no Agility exports any more.** `apps/victory/src/agility.rs` and `apps/victory/build.rs` are gone from the tree based on VIctory-NVIDIA, while `crates/victory-gpu/src/host.rs` still sets `D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED` (line 1129-1130). On Windows 11 the in-box runtime takes both and answers SM 6.6, so nothing there needs a shim; on Windows 10 19045 the in-box runtime refuses them and the title never starts. 2. **The shim from the older tree still fits the new one unchanged.** What I put back on `2f3f3993` (Windows 10 22H2 19045, Arc B580): - `apps/victory/src/agility.rs`: `#[unsafe(no_mangle)] pub static D3D12SDKVersion: u32 = 620;` `#[unsafe(no_mangle)] pub static D3D12SDKPath: SdkPath = SdkPath(c".\\D3D12\\".as_ptr());` plus `runtime_dir()` / `runtime_present()` helpers. - `apps/victory/build.rs` (MSVC only): `cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKVersion,DATA` `cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKPath,DATA` - `apps/victory/src/main.rs`: `mod agility;` - Agility 1.620.2 unpacked to `D3D12\` beside `victory.exe` (`D3D12Core.dll` 4874024 B, `d3d12SDKLayers.dll`). With that, `cargo build --profile diag -p victory --features diagnostics` produces a 15.3 MB `victory.exe`, both symbols show in `strings`, and the title runs to its menus with the full UI and into the intro on an Arc B580. Diagnostics from that run are in #1370. If keeping the export in-tree is unwanted for Windows 11 builds, a `cfg(windows)` module guarded by a feature, or a `cargo xtask agility` that always emits the two exports, would both do; the point is that the two symbols have to be on the executable for 19045 to load `D3D12\D3D12Core.dll`.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/402:upstream-pr/402'
git switch 'upstream-pr/402'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/402'
git switch 'upstream-pr/402'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/402'
git switch 'upstream-pr/402'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/402'
git switch 'main'
git merge --squash 'upstream-pr/402'
git switch 'main'
git merge --ff-only 'upstream-pr/402'
git switch 'main'
git merge 'upstream-pr/402'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!402
No description provided.