Windows 10: load the Agility SDK runtime from a D3D12 folder beside v… #3628

Open
github-bot wants to merge 4 commits from github-bot/gh-3628 into main AGit
Owner

@⁠grosso1337 on GitHub · 2026-11-27 23:41 UTC · original
grosso1337:windows10-agility-sdk → main · +84 −0 · 5 files · 4 commits · open

…ictory.exe

Windows 10's in-box Direct3D 12 runtime refuses root signatures with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED (flags 0xc01), so every host pipeline is refused and the title crashes reading a null pipeline once it draws.

d3d12.dll loads an app-local D3D12Core.dll only when the executable exports D3D12SDKVersion and D3D12SDKPath. victory.exe now exports them (SDK 1.620, path .\D3D12); Rust does not export statics from a binary, so build.rs passes /EXPORT for both to the MSVC linker. Without the folder, d3d12.dll keeps the system runtime, so Windows 11 is unchanged.

Tested on Windows 10 22H2 (19045), RX 6800 XT: pipelines are created and the world is drawn.

**@⁠grosso1337** on GitHub · 2026-11-27 23:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628) `grosso1337:windows10-agility-sdk` → `main` · +84 −0 · 5 files · 4 commits · open …ictory.exe Windows 10's in-box Direct3D 12 runtime refuses root signatures with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED (flags 0xc01), so every host pipeline is refused and the title crashes reading a null pipeline once it draws. d3d12.dll loads an app-local D3D12Core.dll only when the executable exports D3D12SDKVersion and D3D12SDKPath. victory.exe now exports them (SDK 1.620, path .\D3D12\); Rust does not export statics from a binary, so build.rs passes /EXPORT for both to the MSVC linker. Without the folder, d3d12.dll keeps the system runtime, so Windows 11 is unchanged. Tested on Windows 10 22H2 (19045), RX 6800 XT: pipelines are created and the world is drawn.
Windows 10's in-box Direct3D 12 runtime refuses root signatures with
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED
(flags 0xc01), so every host pipeline is refused and the title crashes
reading a null pipeline once it draws.

d3d12.dll loads an app-local D3D12Core.dll only when the executable
exports D3D12SDKVersion and D3D12SDKPath. victory.exe now exports them
(SDK 1.620, path .\D3D12\); Rust does not export statics from a binary,
so build.rs passes /EXPORT for both to the MSVC linker. Without the
folder, d3d12.dll keeps the system runtime, so Windows 11 is unchanged.

Tested on Windows 10 22H2 (19045), RX 6800 XT: pipelines are created
and the world is drawn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015EgQyQAGEtxfc9DQHuxtBb
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:47:01 +00:00
Review of #3628 (thanks, andrewpozdnakov7-jpg): with the exports and no
D3D12 folder, Windows 10 does not fall back to the in-box runtime, and
D3D12CreateDevice fails with 0x887E0003. The exports are now made only
with `--features agility-sdk` (default builds are as before, on Windows
10 and 11 alike), and such a build stops at start with what to copy
where when D3D12\D3D12Core.dll is not beside victory.exe. The README no
longer claims a fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015EgQyQAGEtxfc9DQHuxtBb
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 23:48 UTC · original

I built the exact 3a3d04f MSVC CLI and main 63bcca4 on Windows 10 22H2 (19045.6456). The PR binary exports both SDK symbols. I ran victory translate --cache --pipelines against a generated pack containing one compute pipeline, with a fresh cache for each runtime setup.

Build / runtime Host device New pipelines
main, in-box D3D12 and WARP Ready 0
#3628, no SDK folder, in-box WARP Failed with 0x887E0003 0
#3628, Agility 1.620.2 and in-box WARP Ready 0
#3628, Agility 1.620.2 and WARP 1.0.22 Ready 1

The last setup also got one library hit on a repeat. I launched it from a working directory separate from the executable. An additional cold control on main, with the app-local DLLs in place, still made zero pipelines. This is the CLI counterpart to the synthetic signature and pipeline checks in #3618. Runtime matrix in #3618

The issue to address before merge is the missing-folder case. With the two exports enabled, the tested Windows 10 D3D12CreateDevice path fails with 0x887E0003 instead of creating the in-box device. Please consider keeping SDK selection optional, or document the SDK folder as required for the exported build. The README's Windows 11 fallback claim still needs a Windows 11 run. Microsoft's Agility diagnostics

AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 23:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230418332) I built the exact `3a3d04f` MSVC CLI and `main` `63bcca4` on Windows 10 22H2 (19045.6456). The PR binary exports both SDK symbols. I ran `victory translate --cache --pipelines` against a generated pack containing one compute pipeline, with a fresh cache for each runtime setup. | Build / runtime | Host device | New pipelines | | --- | --- | ---: | | `main`, in-box D3D12 and WARP | Ready | 0 | | #3628, no SDK folder, in-box WARP | Failed with `0x887E0003` | 0 | | #3628, Agility 1.620.2 and in-box WARP | Ready | 0 | | #3628, Agility 1.620.2 and WARP 1.0.22 | Ready | 1 | The last setup also got one library hit on a repeat. I launched it from a working directory separate from the executable. An additional cold control on `main`, with the app-local DLLs in place, still made zero pipelines. This is the CLI counterpart to the synthetic signature and pipeline checks in #3618. [Runtime matrix in #3618](https://git.gtahub.st/github/Marvisak--VIctory/issues/3618) The issue to address before merge is the missing-folder case. With the two exports enabled, the tested Windows 10 `D3D12CreateDevice` path fails with `0x887E0003` instead of creating the in-box device. Please consider keeping SDK selection optional, or document the SDK folder as required for the exported build. The README's Windows 11 fallback claim still needs a Windows 11 run. [Microsoft's Agility diagnostics](https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/#troubleshooting) AI-assisted with Codex.
Author
Owner

@⁠grosso1337 on GitHub · 2026-11-27 23:48 UTC · original

Tested this branch on Windows 10 22H2 (Ryzen 7 9800X3D, RX 6800 XT): without the D3D12 folder every pipeline is refused and the title crashes; with it, the title boots and plays up to the intro cutscene (at the expected ~1 fps).

**@⁠grosso1337** on GitHub · 2026-11-27 23:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230423947) Tested this branch on Windows 10 22H2 (Ryzen 7 9800X3D, RX 6800 XT): without the D3D12 folder every pipeline is refused and the title crashes; with it, the title boots and plays up to the intro cutscene (at the expected ~1 fps).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 23:57 UTC · original

Thanks for making the exports opt-in in 0ff8ece. I checked that head with the feature on and no SDK folder. The startup check also blocks commands that never create a D3D12 device. victory config exits 1, and the existing census_reports_unreadable_files_and_continues_scanning test fails with the missing-SDK message.

7d04554 is a single commit on your exact head. It runs the check for translate --pipelines and run --execute, the commands that request the GPU path. The other commands keep their CPU-only behavior.

On Windows 10 22H2 without the SDK folder, the patched opt-in build passes all 18 CLI tests. config works and translate --cache translates both generated shaders. Adding --pipelines still produces the installation message and exits 1. With Agility 1.620.2 and WARP 1.0.22 in place, it builds the synthetic pipeline and hits the library on the repeat. The default build exported neither SDK symbol and started the in-box WARP device. Strict CLI Clippy and the asset policy passed.

Please keep the Git author on a cherry-pick or rebase. If folding the change into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 23:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230535725) Thanks for making the exports opt-in in `0ff8ece`. I checked that head with the feature on and no SDK folder. The startup check also blocks commands that never create a D3D12 device. `victory config` exits 1, and the existing `census_reports_unreadable_files_and_continues_scanning` test fails with the missing-SDK message. [`7d04554`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/7d04554000d03d208e5be1cfa182fc8c24f2b2d5) is a single commit on your exact head. It runs the check for `translate --pipelines` and `run --execute`, the commands that request the GPU path. The other commands keep their CPU-only behavior. On Windows 10 22H2 without the SDK folder, the patched opt-in build passes all 18 CLI tests. `config` works and `translate --cache` translates both generated shaders. Adding `--pipelines` still produces the installation message and exits 1. With Agility 1.620.2 and WARP 1.0.22 in place, it builds the synthetic pipeline and hits the library on the repeat. The default build exported neither SDK symbol and started the in-box WARP device. Strict CLI Clippy and the asset policy passed. Please keep the Git author on a cherry-pick or rebase. If folding the change into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex.
Author
Owner

@⁠grosso1337 on GitHub · 2026-11-28 00:07 UTC · original

Thanks! Took 7d04554 as is (fast-forward, so your authorship is kept), plus a rustfmt-only commit on top (6cb0996). The startup check now runs only for run --execute and translate --pipelines.

**@⁠grosso1337** on GitHub · 2026-11-28 00:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230669283) Thanks! Took 7d04554 as is (fast-forward, so your authorship is kept), plus a rustfmt-only commit on top (6cb0996). The startup check now runs only for `run --execute` and `translate --pipelines`.
Author
Owner

@⁠upipibi on GitHub · 2026-11-28 00:50 UTC · original

An alternative route to the same runtime, for comparison (read from xcl's source, not run here: I have no Windows 10 machine).

xcl loads an app-supplied D3D12Core.dll without PE exports, through ID3D12SDKConfiguration1::CreateDeviceFactory (xcl crates/xcl/src/gpu/agility.rs:1-17):

  • Its notes say this works on Windows 10 22H2 from build 19045.3393 (KB5029331) and on Windows 11, without Developer Mode.
  • It searches %XCL_D3D12_DIR%, then <exe>\D3D12, <exe> and %LOCALAPPDATA%\XCL\D3D12, and takes the first folder whose D3D12Core.dll exports D3D12SDKVersion.
  • With no folder found, or without the interface, device creation falls back to the in-box D3D12CreateDevice.

Compared with the exports here:

  • What it avoids. The build.rs /EXPORT flags, and the restriction to victory.exe. Any binary could use the factory, including the cargo test executables, which don't carry the two exports and so stay on the in-box runtime on Windows 10.
  • What it costs. Device creation has to go through the factory. On main that is four D3D12CreateDevice sites: victory-gpu/src/host.rs:190, :193 and :718, and the shader test host's emit/host.rs:88. The exports, by contrast, switch the whole process with no code change at those sites.

So the exports are the smaller change for run. The factory would also cover the test binaries on Windows 10, if that matters.

AI-assisted (Claude Code, Claude Opus 5.5 read both projects' code).

**@⁠upipibi** on GitHub · 2026-11-28 00:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7231230678) An alternative route to the same runtime, for comparison (read from xcl's source, not run here: I have no Windows 10 machine). xcl loads an app-supplied `D3D12Core.dll` without PE exports, through `ID3D12SDKConfiguration1::CreateDeviceFactory` (xcl `crates/xcl/src/gpu/agility.rs:1-17`): - Its notes say this works on Windows 10 22H2 from build 19045.3393 (KB5029331) and on Windows 11, without Developer Mode. - It searches `%XCL_D3D12_DIR%`, then `<exe>\D3D12`, `<exe>` and `%LOCALAPPDATA%\XCL\D3D12`, and takes the first folder whose `D3D12Core.dll` exports `D3D12SDKVersion`. - With no folder found, or without the interface, device creation falls back to the in-box `D3D12CreateDevice`. Compared with the exports here: - **What it avoids.** The `build.rs` `/EXPORT` flags, and the restriction to `victory.exe`. Any binary could use the factory, including the `cargo test` executables, which don't carry the two exports and so stay on the in-box runtime on Windows 10. - **What it costs.** Device creation has to go through the factory. On main that is four `D3D12CreateDevice` sites: `victory-gpu/src/host.rs:190`, `:193` and `:718`, and the shader test host's `emit/host.rs:88`. The exports, by contrast, switch the whole process with no code change at those sites. So the exports are the smaller change for `run`. The factory would also cover the test binaries on Windows 10, if that matters. AI-assisted (Claude Code, Claude Opus 5.5 read both projects' code).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3628/head:github-bot/gh-3628'
git switch 'github-bot/gh-3628'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3628'
git switch 'github-bot/gh-3628'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3628'
git switch 'github-bot/gh-3628'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3628'
git switch 'main'
git merge --squash 'github-bot/gh-3628'
git switch 'main'
git merge --ff-only 'github-bot/gh-3628'
git switch 'main'
git merge 'github-bot/gh-3628'
git push origin 'main'
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!3628
No description provided.