Windows 10 support: load the D3D12 Agility SDK runtime from a D3D12 folder #26

Closed
github-bot wants to merge 5 commits from gh-pr/26/head into gh-pr/26/base
Owner

@⁠Schrubbdiwupp on GitHub · 2026-11-28 19:16 UTC · original
Schrubbdiwupp:windows10-agility-sdk → main · +287 −5 · 9 files · 5 commits · closed without merging

On Windows 10, the built-in Direct3D 12 refuses the root signatures with directly indexed descriptor heaps (Shader Model 6.6) that every translated shader uses (Unsupported bit-flag set (root signature flags c00)), so foxhound stops at require_direct_heaps. This PR makes victory.exe export D3D12SDKVersion (620) and D3D12SDKPath (.\D3D12\). With those exports, Direct3D 12 loads Microsoft's Agility SDK runtime from a D3D12 folder beside the exe. Windows 11 is unchanged.

  • apps/victory/src/agility.rs + build.rs: the two exports (/EXPORT:...,DATA)
  • scripts/get-d3d12.ps1: fetches D3D12Core.dll 1.620.2 from nuget.org and keeps it only if it is validly signed by Microsoft. Nothing of Microsoft's is committed (/agility/ is git-ignored).
  • build-launcher.ps1 -Package copies agility\D3D12 into the release folder
  • The Windows 10 error message and the README now say how to fix it

Tested: Windows 10 22H2 (19045), RTX 5070 Ti, Ryzen 7 5800X. The shaders translate, the ~83k pipelines compile, and the title runs. dumpbin /exports victory.exe lists both symbols. cargo xtask policy passes. Pre-existing fmt/clippy findings outside these files are untouched. The linker now prints "Creating library victory.lib" because the exe has exports; that is expected.

— Schrubbdiwupp & TARS 🐾

🤖 Generated with Claude Code

**@⁠Schrubbdiwupp** on GitHub · 2026-11-28 19:16 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/26) `Schrubbdiwupp:windows10-agility-sdk` → `main` · +287 −5 · 9 files · 5 commits · closed without merging On Windows 10, the built-in Direct3D 12 refuses the root signatures with directly indexed descriptor heaps (Shader Model 6.6) that every translated shader uses (`Unsupported bit-flag set (root signature flags c00)`), so foxhound stops at `require_direct_heaps`. This PR makes `victory.exe` export `D3D12SDKVersion` (620) and `D3D12SDKPath` (`.\D3D12\`). With those exports, Direct3D 12 loads Microsoft's Agility SDK runtime from a `D3D12` folder beside the exe. Windows 11 is unchanged. - `apps/victory/src/agility.rs` + `build.rs`: the two exports (`/EXPORT:...,DATA`) - `scripts/get-d3d12.ps1`: fetches `D3D12Core.dll` 1.620.2 from nuget.org and keeps it only if it is validly signed by Microsoft. Nothing of Microsoft's is committed (`/agility/` is git-ignored). - `build-launcher.ps1 -Package` copies `agility\D3D12` into the release folder - The Windows 10 error message and the README now say how to fix it **Tested:** Windows 10 22H2 (19045), RTX 5070 Ti, Ryzen 7 5800X. The shaders translate, the ~83k pipelines compile, and the title runs. `dumpbin /exports victory.exe` lists both symbols. `cargo xtask policy` passes. Pre-existing fmt/clippy findings outside these files are untouched. The linker now prints "Creating library victory.lib" because the exe has exports; that is expected. — Schrubbdiwupp & TARS 🐾 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Windows 10's built-in Direct3D 12 refuses the root signatures with directly
indexed descriptor heaps (Shader Model 6.6) that every translated shader
uses, so the layer stopped at require_direct_heaps.

victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath (.\D3D12\):
Direct3D 12 then loads Microsoft's Agility SDK runtime from a D3D12 folder
beside the exe. Windows 11 is unchanged.

- apps/victory/src/agility.rs, build.rs: the two exports (/EXPORT:...,DATA)
- scripts/get-d3d12.ps1: fetches D3D12Core.dll 1.620.2 from nuget.org,
  kept only when validly signed by Microsoft; /agility/ is git-ignored
- build-launcher.ps1 -Package copies agility\D3D12 into the release
- the Windows 10 error message and the README say how to fix it

Tested on Windows 10 22H2 (19045), RTX 5070 Ti: shaders translate, the
pipelines compile and the title runs.

By Schrubbdiwupp & TARS

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows 10 without D3D12\D3D12Core.dll beside victory.exe, Play now asks
once whether to download Microsoft's D3D12 Agility SDK runtime, and fetches
it as the first step on the loading screen (log: get-d3d12.log). Without it
the game would stop at the start; saying no leaves a note in the status line.

- victory get-d3d12: carries scripts\get-d3d12.ps1 (include_str!) and runs
  it into D3D12 beside the program, so the release needs no scripts
- Launcher.cs: D3d12Check (Windows build < 22000 from the registry, file
  missing), the question in Play, the fetch in Prepare

Tested on Windows 10 22H2: victory.exe get-d3d12 in an empty folder fetched
D3D12Core.dll 1.620.2, signed by Microsoft; the launcher compiles with the
.NET Framework csc as before.

By Schrubbdiwupp & TARS

Co-Authored-By: Claude Opus 5.5 <[email protected]>
D3D12SDKVersion was a constant 620. Above Windows' own runtime Direct3D 12
insists on the redistributable, so Windows 11 without a D3D12 folder failed
with D3D12_ERROR_INVALID_REDIST (reported in #26).

Now agility::match_d3d12_core sets it first thing in main (and again after
`victory get-d3d12`): the version of D3D12\D3D12Core.dll when the folder is
there, else Windows' own (System32's D3D12Core.dll export, at most 614).
d3d12.dll is delay-loaded so it reads the value set at run time.
The matching follows trustno1-coder/VIctory-NVIDIA (GPL-3.0-or-later).

Tested on Windows 10 22H2 (19045), RTX 5070 Ti, driver 621.x, with
`victory upscaler-check --device`: without the folder the device is created
on Windows' own runtime (no redist error; it then reports shader model 6.5,
as expected on Windows 10); with the folder (Agility 1.620.2) the host
device is ready and DLSS runs. Not tested on Windows 11 here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:23:20 +00:00
github-bot closed this pull request 2026-11-30 02:23:20 +00:00
Author
Owner

@⁠Schrubbdiwupp on GitHub · 2026-11-28 21:58 UTC · original

Added a follow-up commit (fb54217): on Windows 10 the launcher now offers to fetch the runtime itself, so release users never need the script.

  • victory get-d3d12: carries scripts\get-d3d12.ps1 (include_str!) and runs it into D3D12 beside the program
  • Launcher.cs: D3d12Check (Windows build < 22000 from the registry, D3D12\D3D12Core.dll missing). Play asks once and fetches it as the first loading-screen step (get-d3d12.log). Saying no leaves a note in the status line. Windows 11 never sees any of it.

Tested on Windows 10 22H2: victory.exe get-d3d12 in an empty folder fetched D3D12Core.dll 1.620.2 (Microsoft signature valid). The launcher builds with build-launcher.ps1 as before. cargo clippy -p victory --no-deps reports nothing in the changed files (the one finding, warm.rs:92, predates this PR).

— Schrubbdiwupp & TARS 🐾

**@⁠Schrubbdiwupp** on GitHub · 2026-11-28 21:58 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/26#issuecomment-7246407591) Added a follow-up commit (`fb54217`): on Windows 10 the **launcher now offers to fetch the runtime itself**, so release users never need the script. - `victory get-d3d12`: carries `scripts\get-d3d12.ps1` (`include_str!`) and runs it into `D3D12` beside the program - `Launcher.cs`: `D3d12Check` (Windows build < 22000 from the registry, `D3D12\D3D12Core.dll` missing). Play asks once and fetches it as the first loading-screen step (`get-d3d12.log`). Saying no leaves a note in the status line. Windows 11 never sees any of it. Tested on Windows 10 22H2: `victory.exe get-d3d12` in an empty folder fetched `D3D12Core.dll` 1.620.2 (Microsoft signature valid). The launcher builds with `build-launcher.ps1` as before. `cargo clippy -p victory --no-deps` reports nothing in the changed files (the one finding, `warm.rs:92`, predates this PR). — Schrubbdiwupp & TARS 🐾
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-11-29 06:14 UTC · original

Thanks for this, and for testing on Windows 10. I ported it and ran it on Windows 11, where it stops at the start:

  • Setup: Windows 11 build 26300, RTX 4070 SUPER, driver 621.x, no D3D12 folder beside victory.exe (the case for every Windows 11 user who never runs get-d3d12).
  • Result: the title's runtime got D3D12_ERROR_INVALID_REDIST (0x887E0003) from D3D12SerializeVersionedRootSignature, and the run ended before the window appeared.
  • Cause, as far as I can tell: with D3D12SDKVersion = 620 higher than the system's own runtime, Direct3D 12 requires the redistributable and does not fall back to Windows' runtime when the folder is missing.

So I took it back out for now. Two ways I see to bring it back:

  1. Export an SDK version at or below Windows 11's own runtime (still above Windows 10's), with the matching D3D12Core.dll version in the folder. Then Windows 11 keeps its own runtime, and Windows 10 loads the folder.
  2. Always ship the D3D12 folder. That puts Microsoft's DLL into every release, so I'd rather avoid it.

If you can rework it along the lines of (1) and check that Windows 11 without the folder still starts, I'll take it. The launcher's Windows 10 question and the fetch script look good as they are.

**@⁠readmet3xt-lab** on GitHub · 2026-11-29 06:14 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/26#issuecomment-7251733901) Thanks for this, and for testing on Windows 10. I ported it and ran it on Windows 11, where it stops at the start: - Setup: Windows 11 build 26300, RTX 4070 SUPER, driver 621.x, no `D3D12` folder beside `victory.exe` (the case for every Windows 11 user who never runs `get-d3d12`). - Result: the title's runtime got `D3D12_ERROR_INVALID_REDIST` (`0x887E0003`) from `D3D12SerializeVersionedRootSignature`, and the run ended before the window appeared. - Cause, as far as I can tell: with `D3D12SDKVersion` = 620 higher than the system's own runtime, Direct3D 12 requires the redistributable and does not fall back to Windows' runtime when the folder is missing. So I took it back out for now. Two ways I see to bring it back: 1. Export an SDK version at or below Windows 11's own runtime (still above Windows 10's), with the matching `D3D12Core.dll` version in the folder. Then Windows 11 keeps its own runtime, and Windows 10 loads the folder. 2. Always ship the `D3D12` folder. That puts Microsoft's DLL into every release, so I'd rather avoid it. If you can rework it along the lines of (1) and check that Windows 11 without the folder still starts, I'll take it. The launcher's Windows 10 question and the fetch script look good as they are.
Author
Owner

@⁠Schrubbdiwupp on GitHub · 2026-11-29 16:45 UTC · original

Thanks for porting and testing it on Windows 11, and for the clear write-up. Reworked along your option (1), but decided at run time instead of with a fixed lower number (commit 18a1f40, rebased on v0.8.1):

  • agility::match_d3d12_core() runs first thing in main (and again after victory get-d3d12). With D3D12\D3D12Core.dll beside the program it asks for that file's version; without it, for Windows' own (the D3D12SDKVersion System32's D3D12Core.dll exports, capped at 614). So Windows 11 without the folder keeps its own runtime and never needs the redistributable.
  • D3D12SDKVersion is now an AtomicU32, and d3d12.dll is delay-loaded (/DELAYLOAD:d3d12.dll, delayimp.lib), so Direct3D 12 reads the value set at run time, not the static's first one.
  • This is how trustno1-coder/VIctory-NVIDIA solved the same Windows 11 case; the version matching follows its main.rs (GPL-3.0-or-later), credited in agility.rs.

Tested on Windows 10 22H2 (19045), RTX 5070 Ti, with victory upscaler-check --device:

  • without the D3D12 folder: the device is created on Windows' own runtime, no INVALID_REDIST; it then says shader model 6.5, as expected on Windows 10 (the launcher's fetch covers that)
  • with the folder (Agility 1.620.2): host device ready, DLSS runs

I can't test Windows 11 here, so a run on your Windows 11 machine without the folder would be the real check. cargo test -p victory agility passes and clippy reports nothing in the changed files.

— Schrubbdiwupp & TARS 🐾 (AI-assisted)

**@⁠Schrubbdiwupp** on GitHub · 2026-11-29 16:45 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/26#issuecomment-7259156076) Thanks for porting and testing it on Windows 11, and for the clear write-up. Reworked along your option (1), but decided at run time instead of with a fixed lower number (commit `18a1f40`, rebased on v0.8.1): - `agility::match_d3d12_core()` runs first thing in `main` (and again after `victory get-d3d12`). With `D3D12\D3D12Core.dll` beside the program it asks for that file's version; without it, for **Windows' own** (the `D3D12SDKVersion` System32's `D3D12Core.dll` exports, capped at 614). So Windows 11 without the folder keeps its own runtime and never needs the redistributable. - `D3D12SDKVersion` is now an `AtomicU32`, and `d3d12.dll` is delay-loaded (`/DELAYLOAD:d3d12.dll`, `delayimp.lib`), so Direct3D 12 reads the value set at run time, not the static's first one. - This is how trustno1-coder/VIctory-NVIDIA solved the same Windows 11 case; the version matching follows its `main.rs` (GPL-3.0-or-later), credited in `agility.rs`. Tested on Windows 10 22H2 (19045), RTX 5070 Ti, with `victory upscaler-check --device`: - without the `D3D12` folder: the device is created on Windows' own runtime, no `INVALID_REDIST`; it then says shader model 6.5, as expected on Windows 10 (the launcher's fetch covers that) - with the folder (Agility 1.620.2): host device ready, DLSS runs I can't test Windows 11 here, so a run on your Windows 11 machine without the folder would be the real check. `cargo test -p victory agility` passes and clippy reports nothing in the changed files. — Schrubbdiwupp & TARS 🐾 (AI-assisted)
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-11-30 02:14 UTC · original

Ported with credit in fb7468f (to you, and to VIctory-NVIDIA for the version matching). Two small changes: a launcher comment held two control characters where the path apps\victory\src\agility.rs was (a \v and an \a taken as escapes), fixed; and the README now says the launcher offers to fetch the runtime on Windows 10. On our Windows 11 PC (no D3D12 folder) victory.exe still makes its device and runs DLSS. Thanks for reworking it.

**@⁠readmet3xt-lab** on GitHub · 2026-11-30 02:14 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/26#issuecomment-7266826548) Ported with credit in fb7468f (to you, and to VIctory-NVIDIA for the version matching). Two small changes: a launcher comment held two control characters where the path `apps\victory\src\agility.rs` was (a `\v` and an `\a` taken as escapes), fixed; and the README now says the launcher offers to fetch the runtime on Windows 10. On our Windows 11 PC (no `D3D12` folder) `victory.exe` still makes its device and runs DLSS. Thanks for reworking it.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.