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

Open
grosso1337 wants to merge 4 commits from upstream-pr/3628 into main
grosso1337 commented 2026-11-27 23:41:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by grosso1337 on 2026-11-27T23:41:49Z.


…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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5534542831 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628). Originally posted by [grosso1337](https://github.com/grosso1337) on 2026-11-27T23:41:49Z. --- …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.
andrewpozdnakov7-jpg commented 2026-11-27 23:48:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:48:04Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230418332 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230418332). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:48:04Z. --- 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://github.com/Marvisak/VIctory/issues/3618#issuecomment-7229683462) 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.
grosso1337 commented 2026-11-27 23:48:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by grosso1337 on 2026-11-27T23:48:31Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230423947 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230423947). Originally posted by [grosso1337](https://github.com/grosso1337) on 2026-11-27T23:48:31Z. --- 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).
andrewpozdnakov7-jpg commented 2026-11-27 23:57:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T23:57:33Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230535725 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230535725). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T23:57:33Z. --- 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.
grosso1337 commented 2026-11-28 00:07:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by grosso1337 on 2026-11-28T00:07:43Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7230669283 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7230669283). Originally posted by [grosso1337](https://github.com/grosso1337) on 2026-11-28T00:07:43Z. --- 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`.
upipibi commented 2026-11-28 00:50:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T00:50:32Z.


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.

Added 2026-11-28: five open PRs now do this (read from the PR texts and diffs, not run):

PR Route State
#3667 (kotekompotek, closes #753) exports from build.rs, version read from the staged D3D12Core.dll, scoped to bin=victory, plus a victory agility-probe command mergeable; Windows 10 GTX 1050 probe and a boot past frame 5,980
this PR (#3628) exports from build.rs (sdkpath.rs) mergeable
#2460 (lhnizdo) exports from build.rs triage: needs work
#3033 (Auroraooy) CreateDeviceFactory, in its own victory-agility crate triage: needs work
#969 (mgunes1311-lab) CreateDeviceFactory, no exports triage: needs rebase

The export PRs are rival answers to the same thing, and #3667 says it supersedes #463. #3033 and #969 are the factory route above, which would also cover the test binaries.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7231230678 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3628#issuecomment-7231230678). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T00:50:32Z. --- 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. **Added 2026-11-28: five open PRs now do this** (read from the PR texts and diffs, not run): | PR | Route | State | |---|---|---| | #3667 (kotekompotek, closes #753) | exports from `build.rs`, version read from the staged `D3D12Core.dll`, scoped to `bin=victory`, plus a `victory agility-probe` command | mergeable; Windows 10 GTX 1050 probe and a boot past frame 5,980 | | this PR (#3628) | exports from `build.rs` (`sdkpath.rs`) | mergeable | | #2460 (lhnizdo) | exports from `build.rs` | triage: needs work | | #3033 (Auroraooy) | `CreateDeviceFactory`, in its own `victory-agility` crate | triage: needs work | | #969 (mgunes1311-lab) | `CreateDeviceFactory`, no exports | triage: needs rebase | The export PRs are rival answers to the same thing, and #3667 says it supersedes #463. #3033 and #969 are the factory route above, which would also cover the test binaries. AI-assisted (Claude Code, Claude Opus 5.5 read both projects' code).
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/3628:upstream-pr/3628'
git switch 'upstream-pr/3628'

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/3628'
git switch 'upstream-pr/3628'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3628'
git switch 'upstream-pr/3628'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3628'
git switch 'main'
git merge --squash 'upstream-pr/3628'
git switch 'main'
git merge --ff-only 'upstream-pr/3628'
git switch 'main'
git merge 'upstream-pr/3628'
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
Marvisak/VIctory!3628
No description provided.