Bundle the DirectX 12 Agility SDK so SM 6.6 is actually available #286

Open
github-bot wants to merge 1 commit from github-bot/gh-286 into main AGit
Owner

@⁠ZaneIceMaster11 on GitHub · 2026-11-24 23:15 UTC · original
ZaneIceMaster11:fix/shader-model-6-6-agility-sdk → main · +344 −4 · 10 files · 1 commits · open

Problem

On Windows 10 22H2 (this fork's test machine, NVIDIA RTX 3060, current driver), the OS in-box d3d12.dll caps shader model at 6.5 on hardware and 6.2 on WARP, even though the driver itself is fully DX12 Ultimate capable. This failed 22 victory-shader GPU tests outright (no SM 6.6 device available), and would have silently gated off victory-gpu's mesh/world path too, since it checks the identical D3D_SHADER_MODEL_6_6 feature (crates/victory-gpu/src/host.rs).

Root cause confirmed by temporarily surfacing the swallowed Host::new() error: hardware reports SM 0x65, WARP reports SM 0x62, both below the 0x66 required. No code in the tree referenced the Agility SDK before this change.

Fix

  • cargo xtask agility-sdk (new): fetches Microsoft.Direct3D.D3D12 1.620.2 from nuget.org (pinned URL + sha256, extracted via Windows' own tar.exe) into target/agility-sdk/ (gitignored, not game data, not committed - matches this repo's no-committed-binaries policy).
  • New build.rs in apps/victory and crates/victory-shader: export the required D3D12SDKVersion/D3D12SDKPath DATA symbols and copy the two redistributable DLLs next to the built exe/test binaries, if fetched.
  • With no fetch and no network, a plain cargo build/cargo test is unaffected (falls back to the OS runtime, today's behaviour) - the tree stays green either way.

Verification

  • cargo test -p victory-shader --features host emit:: went from 22 failed to 108 passed, 0 failed (includes the BVH ray/node tests matching the reference bit for bit on both the hardware adapter and WARP).
  • cargo build --release --workspace and cargo clippy --workspace --all-targets --release: clean, 0 warnings.

Co-authored with Claude Code (Claude Sonnet 5).

**@⁠ZaneIceMaster11** on GitHub · 2026-11-24 23:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/286) `ZaneIceMaster11:fix/shader-model-6-6-agility-sdk` → `main` · +344 −4 · 10 files · 1 commits · open ## Problem On Windows 10 22H2 (this fork's test machine, NVIDIA RTX 3060, current driver), the OS in-box `d3d12.dll` caps shader model at **6.5 on hardware** and **6.2 on WARP**, even though the driver itself is fully DX12 Ultimate capable. This failed 22 `victory-shader` GPU tests outright (`no SM 6.6 device available`), and would have silently gated off `victory-gpu`'s mesh/world path too, since it checks the identical `D3D_SHADER_MODEL_6_6` feature (`crates/victory-gpu/src/host.rs`). Root cause confirmed by temporarily surfacing the swallowed `Host::new()` error: hardware reports SM `0x65`, WARP reports SM `0x62`, both below the `0x66` required. No code in the tree referenced the Agility SDK before this change. ## Fix - `cargo xtask agility-sdk` (new): fetches `Microsoft.Direct3D.D3D12` 1.620.2 from nuget.org (pinned URL + sha256, extracted via Windows' own `tar.exe`) into `target/agility-sdk/` (gitignored, not game data, not committed - matches this repo's no-committed-binaries policy). - New `build.rs` in `apps/victory` and `crates/victory-shader`: export the required `D3D12SDKVersion`/`D3D12SDKPath` DATA symbols and copy the two redistributable DLLs next to the built exe/test binaries, if fetched. - With no fetch and no network, a plain `cargo build`/`cargo test` is unaffected (falls back to the OS runtime, today's behaviour) - the tree stays green either way. ## Verification - `cargo test -p victory-shader --features host emit::` went from **22 failed** to **108 passed, 0 failed** (includes the BVH ray/node tests matching the reference bit for bit on both the hardware adapter and WARP). - `cargo build --release --workspace` and `cargo clippy --workspace --all-targets --release`: clean, 0 warnings. Co-authored with Claude Code (Claude Sonnet 5).
On Windows 10 22H2 (this fork's test machine, NVIDIA RTX 3060, current driver),
the OS in-box d3d12.dll caps shader model at 6.5 on hardware and 6.2 on WARP,
even though the driver itself is fully DX12 Ultimate capable. This failed 22
victory-shader GPU tests outright ("no SM 6.6 device available") and would
have silently gated off victory-gpu's mesh/world path too, since it checks the
identical D3D_SHADER_MODEL_6_6 feature (crates/victory-gpu/src/host.rs).

Root cause confirmed by temporarily surfacing the swallowed Host::new() error:
hardware reports SM 0x65, WARP reports SM 0x62, both below the 0x66 required.
No prior code in the tree referenced the Agility SDK at all.

Fix: `cargo xtask agility-sdk` (new, xtask/src/agility.rs) fetches
Microsoft.Direct3D.D3D12 1.620.2 from nuget.org (pinned URL + sha256,
extracted via Windows' own tar.exe) into target/agility-sdk/ (gitignored,
not game data, not committed - matches this repo's no-committed-binaries
policy). New build.rs files in apps/victory and crates/victory-shader export
the required D3D12SDKVersion/D3D12SDKPath DATA symbols and copy the two
redistributable DLLs next to the built exe/test binaries when fetched. With
no fetch and no network, a plain `cargo build`/`cargo test` is unaffected
(falls back to the OS runtime, today's behaviour) - the tree stays green
either way.

Verified: cargo test -p victory-shader --features host emit:: went from
22 failed to 108 passed, 0 failed (includes the BVH ray/node tests matching
the reference bit for bit on both the hardware adapter and WARP). Full
`cargo build --release --workspace` and `cargo clippy --workspace
--all-targets --release` are clean, 0 warnings.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:56 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/build.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-286'
git switch 'github-bot/gh-286'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-286'
git switch 'github-bot/gh-286'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-286'
git switch 'main'
git merge --squash 'github-bot/gh-286'
git switch 'main'
git merge --ff-only 'github-bot/gh-286'
git switch 'main'
git merge 'github-bot/gh-286'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.