Skip to content

Windows 10: the D3D12 Agility SDK runtime for shader model 6.6 (upstream #362) - #69

Open
simplesmenterafael wants to merge 5 commits into
fxceless:mainfrom
simplesmenterafael:gpu/agility-sdk-win10
Open

simplesmenterafael wants to merge 5 commits into
fxceless:mainfrom
simplesmenterafael:gpu/agility-sdk-win10

Conversation

@simplesmenterafael

Copy link
Copy Markdown

Brings Marvisak/VIctory#362 (stacked on Marvisak/VIctory#175, for Marvisak/VIctory#84) into this fork: Windows 10's in-box D3D12 runtime stops at shader model 6.5, so on Windows 10 no SM 6.6 device exists and every translated pipeline is refused. Both upstream PRs are still open; this takes them as they are, plus one manifest fix.

What is in it

  • Merge of upstream GPU: a buffer view off its copy's elements gets a copy of its own instead of a null slot #362 (commits 19aec59, f3c7333 and its merge of upstream main, authors kept):
    • victory.exe exports D3D12SDKVersion = 620 and D3D12SDKPath = ".\D3D12\" (apps/victory/build.rs, apps/victory/src/agility.rs); victory config says whether the runtime is beside the executable.
    • victory-shader's test executables export the same two symbols (path ..\D3D12\), only when the runtime is in target\<profile>\D3D12\ (crates/victory-shader/build.rs, src/agility.rs). Without it nothing changes.
    • cargo xtask agility downloads Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, checks the SHA-512 nuget.org publishes, and puts D3D12Core.dll and d3d12SDKLayers.dll in target\{debug,release,diag}\D3D12\. Nothing of Microsoft's enters the repository.
    • The SM 6.5 error message points at cargo xtask agility; the README's getting-started section (upstream part, upstream's own text) mentions it.
  • One conflict in crates/victory-shader/src/lib.rs: this fork's pub mod bvh; and the PR's mod agility;, both kept.
  • sha2 moved to [workspace.dependencies] (0.10.9, the version Cargo.lock already has; MIT OR Apache-2.0). The upstream PR named it in xtask/Cargo.toml only.

Tested

  • Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 3050 (driver 32.0.16.2124), AMD Ryzen 5 3600, 16 GB RAM.
  • rustc 1.98.1 (48a229cea 2026-09-01).
  • Before (main at 90228a7, no runtime): the RTX 3050 reports SM 0x65 and WARP SM 0x62 (checked with a small probe outside the repo). cargo test --workspace --locked --no-fail-fast: 474 passed, 22 failed, 7 ignored: all 22 are victory-shader GPU tests (no SM 6.6 device available). Separately, victory-loader's crash::tests::unwinds_like_the_system_walk fails intermittently on this machine (Windows 10: unwinds_like_the_system_walk fails about half the time (RtlCaptureStackBackTrace returns no frames) Marvisak/VIctory#742, unrelated; it passed in the runs counted here).
  • After (this branch, cargo xtask agility run): cargo test --workspace --locked --no-fail-fast: 498 passed, 0 failed, 7 ignored (the 2 extra tests are the new xtask agility ones); victory-shader 210 passed, 2 ignored, no device skipped (hardware and WARP both ran).
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.
  • cargo xtask policy: 174 files ok.

Before / after

Title run: NOT RUN at the time of opening (will be reported in a comment if done).

Not tested / known limits

Asset policy

cargo xtask policy passes. The Agility SDK DLLs and the NuGet package are kept under target\ only; nothing derived from the game is included.

AI use

Claude Code with Claude Opus 5.5: found the existing upstream work, read the PR's code before running it, merged it and resolved the conflict, moved sha2, ran the tests and checks above, and wrote this description. The user asked for the merge, the push and this PR.

🤖 Generated with Claude Code

kykifox1337-source and others added 5 commits November 23, 2026 20:23
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 (fxceless#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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows 10 the victory-shader test executables had no D3D12SDKVersion
and D3D12SDKPath exports, so every host device stopped at shader model 6.5:
the 7 emit::valu_tests failed and the device-backed tests skipped.

The tests now export them (path ..\D3D12\, the folder `cargo xtask
agility` fills) only when D3D12Core.dll is there: D3D12 does not fall back
to the in-box runtime when the named one is missing. The build script
watches the DLL only when it exists, so a missing runtime does not rebuild
the crate every time; the xtask touches build.rs after installing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y-runtime

# Conflicts:
#	apps/victory/src/main.rs
…ows 10

Windows 10's in-box D3D12 stops at shader model 6.5, so no SM 6.6
device existed on this machine and 22 victory-shader GPU tests failed
("no SM 6.6 device available"). This merges Marvisak/VIctory#362
(stacked on fxceless#175): victory.exe and the victory-shader test executables
export D3D12SDKVersion/D3D12SDKPath, and `cargo xtask agility` fetches
Microsoft.Direct3D.D3D12 1.620.2 (SHA-512 checked) into
target/<profile>/D3D12/. Nothing of Microsoft's enters the repository.

One conflict, in crates/victory-shader/src/lib.rs: this fork's
`pub mod bvh;` and the PR's `mod agility;`; both kept.

Checked on Windows 10 19045, RTX 3050 (driver 32.0.16.2124),
Ryzen 5 3600, rustc 1.98.1: cargo test --workspace --locked
--no-fail-fast 498 passed, 0 failed, 7 ignored (was 22 failed);
both clippy runs from CI clean; cargo xtask policy ok. The title was
not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merged xtask agility command named sha2 = "0.10" in xtask's own
manifest; this repository keeps every external crate in
[workspace.dependencies]. Pinned at the version Cargo.lock already
has (0.10.9, MIT OR Apache-2.0), so the lock file does not change.

Checked with cargo test --workspace --locked (498 passed, 0 failed,
7 ignored), both clippy runs from CI and cargo xtask policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simplesmenterafael

Copy link
Copy Markdown
Author

Title run with this branch (2cd8b02, release build, Series X profile) on the machine in the description. In words only, no captures.

Before (main): NOT RUN; on this machine main has no SM 6.6 device, so its pipelines would be refused (Marvisak/VIctory#84).

Run and written with Claude Code (Claude Opus 5.5).

@avt0m4t48

Copy link
Copy Markdown

I checked exact head 2cd8b023 with an MSVC-target build script and a minimal Windows PE made from the app's export definitions. It exports SDK version 620 and its path even when the local Core DLL is missing. On a machine whose inbox runtime is older than the exported version, the loader requires the local runtime. Microsoft Agility SDK loader specification

I tested a follow-up that gates the exports on the installed Core DLL at build time and makes the installer invalidate both Cargo build scripts. The PE and directive controls, installer-style invalidation fixture, six xtask tests, and Windows-target app check with blake3/pure passed. Native Windows D3D12 device creation remains unverified. Tested follow-up commit

AI-assisted using Codex.

@HAL9000RELOADED

Copy link
Copy Markdown

A data point for this approach on AMD + Windows 10, and two notes. They come from #401, now closed as a duplicate of this PR.

Machine: Windows 10 Pro 22H2 (19045), Radeon RX 7900 XTX, Adrenalin 32.0.32015.7029, i7-13700KF, Rust 1.98.1. No game data used.

  • In-box runtime: SM 0x65.
  • With Microsoft.Direct3D.D3D12 1.620.2 in .\D3D12\ (D3D12SDKVersion = 620), checked with a standalone C probe:
    • D3D12CreateDevice succeeds, with D3D12Core.dll loaded from .\D3D12\.
    • HighestShaderModel = 0x69 and MeshShaderTier = 1.
  • victory-shader tests (on main with an equivalent patch): 22 failed (no SM 6.6 device available) became 210 passed on the card. On this machine WARP still reports below 6.6 and skips.
  • Whole workspace on current main (c96b4f2) plus the same patch and GPU/draw: evict CBV-backed fresh_tables on State::replay across cut lists #742's stack-headroom test fix: 0 failed, and clippy with all features is clean.

Note 1: victory.exe without the runtime folder.

  • apps/victory/build.rs exports unconditionally.
  • apps/victory/src/agility.rs says that without the folder the in-box runtime is used. That is not what happens here: a probe exporting D3D12SDKVersion = 620 with no D3D12\ folder gets 0x887E0003 (D3D12_ERROR_INVALID_REDIST) from D3D12CreateDevice and no device.
  • So a victory.exe built without cargo xtask agility would have no host GPU. I have not checked Windows 11; there it presumably depends on whether the in-box runtime is at least 620.
  • crates/victory-shader/build.rs already says this in its comment and only exports when the runtime is present. The binary might want the same treatment, or a clear error naming cargo xtask agility.

Note 2: victory-gpu's tests get no exports here. victory-gpu's unit-test harness also creates host devices: host(), the mesh pipeline test in pipeline/host.rs, and the WARP harnesses in indirect.rs and inplace.rs. Without the exports, its SM 6.6 and mesh-dependent tests keep skipping silently on Windows 10.

@domints

domints commented Nov 25, 2026

Copy link
Copy Markdown

This PR has merge conflicts.
Moreover adds unnecessary miniz_oxide back to the root Cargo.toml leaving app with two zip unpacking packages.

I suggest closing both this and #420 (which also has conflicts, but also doesn't resolve miniz_oxide problem) in favor of #402 which is minimal change, resolves conflicts and uses zlib-rs instead of just re-pulling miniz_oxide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants