Windows 10: export D3D12SDKVersion/D3D12SDKPath and fetch the Agility SDK (#69) #73

Closed
github-bot wants to merge 0 commits from github-bot/gh-73 into main AGit
Owner

@⁠Hasusmogus on GitHub · 2026-11-27 08:13 UTC · original
Hasusmogus:fix-69-agility → main · +102 −0 · 5 files · 2 commits · closed without merging

Addresses the root signature part of #69 (Windows 10, 0x80070057 for root signatures with flags c00/c01).

Translated shaders use shader model 6.6 bindless heaps (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED), which Windows 10's own D3D12 runtime does not take. The usual answer is the D3D12 Agility SDK, which is what the reporter did by hand. The repo now does it:

  • apps/victory/src/agility.rs, only with --features agility-sdk: exports D3D12SDKVersion = 619 and D3D12SDKPath = ".\\D3D12\\" from victory.exe (a .drectve directive in the object tells the linker, as dllexport does; an executable exports nothing otherwise, which is why the reporter needed the /EXPORT lines).
  • scripts/get-agility-sdk.ps1: downloads Microsoft.Direct3D.D3D12 1.619.6 (the version the reporter confirmed) from nuget.org and copies D3D12Core.dll and d3d12SDKLayers.dll into target\release\D3D12\ and target\diag\D3D12\. The DLLs are never committed (asset policy).
  • README: the Windows 10 build (--features agility-sdk, then the script).

Opt-in, and why (changed after the first version of this PR): with the exports and no D3D12Core.dll in D3D12\, D3D12 does not fall back to the system's runtime. Every call fails with D3D12_ERROR_INVALID_REDIST (0x887E0003), which is what Windows CI's GPU tests hit with the exports always on. So the default build exports nothing and is exactly as before; only a Windows 10 build asks for the SDK. Under Wine and Proton, vkd3d-proton is the runtime and the exports change nothing.

Checked

  • Built with cargo-xwin: without the feature victory.exe exports nothing; with it llvm-readobj --coff-exports lists both, and reading them back out of the file gives 619 and .\D3D12\.
  • cargo clippy --workspace --all-targets [--all-features] -- -D warnings: clean; asset policy passes.
  • Not run on Windows 10 here. The rest of #69 (unknown_pipeline slots 0x1c8/0x218 and the write to null at +0x23cf683 on the RX 9070) is a separate problem and not touched.

🤖 Generated with Claude Code

**@⁠Hasusmogus** on GitHub · 2026-11-27 08:13 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/73) `Hasusmogus:fix-69-agility` → `main` · +102 −0 · 5 files · 2 commits · closed without merging Addresses the root signature part of #69 (Windows 10, `0x80070057` for root signatures with flags `c00`/`c01`). Translated shaders use shader model 6.6 bindless heaps (`CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED`), which Windows 10's own D3D12 runtime does not take. The usual answer is the D3D12 Agility SDK, which is what the reporter did by hand. The repo now does it: - `apps/victory/src/agility.rs`, **only with `--features agility-sdk`**: exports `D3D12SDKVersion = 619` and `D3D12SDKPath = ".\\D3D12\\"` from `victory.exe` (a `.drectve` directive in the object tells the linker, as `dllexport` does; an executable exports nothing otherwise, which is why the reporter needed the `/EXPORT` lines). - `scripts/get-agility-sdk.ps1`: downloads `Microsoft.Direct3D.D3D12` 1.619.6 (the version the reporter confirmed) from nuget.org and copies `D3D12Core.dll` and `d3d12SDKLayers.dll` into `target\release\D3D12\` and `target\diag\D3D12\`. The DLLs are never committed (asset policy). - README: the Windows 10 build (`--features agility-sdk`, then the script). **Opt-in, and why** (changed after the first version of this PR): with the exports and no `D3D12Core.dll` in `D3D12\`, D3D12 does *not* fall back to the system's runtime. Every call fails with `D3D12_ERROR_INVALID_REDIST` (`0x887E0003`), which is what Windows CI's GPU tests hit with the exports always on. So the default build exports nothing and is exactly as before; only a Windows 10 build asks for the SDK. Under Wine and Proton, vkd3d-proton is the runtime and the exports change nothing. ## Checked - Built with cargo-xwin: without the feature `victory.exe` exports nothing; with it `llvm-readobj --coff-exports` lists both, and reading them back out of the file gives `619` and `.\D3D12\`. - `cargo clippy --workspace --all-targets [--all-features] -- -D warnings`: clean; asset policy passes. - Not run on Windows 10 here. The rest of #69 (`unknown_pipeline` slots 0x1c8/0x218 and the write to null at `+0x23cf683` on the RX 9070) is a separate problem and not touched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Windows 10's own D3D12 has no shader model 6.6 bindless heaps: root
signatures with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED failed with E_INVALIDARG.
victory.exe now exports the Agility SDK's two symbols (version 619, path
.\\D3D12\\; build.rs has the linker export them), and
scripts/get-agility-sdk.ps1 puts D3D12Core.dll 1.619.6 from NuGet there.
Without the DLL, or where the system's is newer, the runtime uses its
own, as before. The DLLs are fetched, never committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 08:16:49 +00:00
With D3D12SDKVersion exported and no D3D12Core.dll in D3D12\\, D3D12 does
not fall back to the system's runtime: every call fails with
D3D12_ERROR_INVALID_REDIST (0x887E0003), as Windows CI's GPU tests did
with the same exports. So a default build exports nothing, as before,
and Windows 10 builds with --features agility-sdk and runs the script.
The exports are now told to the linker by a .drectve directive in the
module, and build.rs is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot closed this pull request 2026-11-27 08:56:26 +00:00
Author
Owner

@⁠DoubleGhosty on GitHub · 2026-11-27 08:53 UTC · original

Cherry-picked into main as d4315922..e5055d6d. Thanks!

**@⁠DoubleGhosty** on GitHub · 2026-11-27 08:53 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/73#issuecomment-7214045898) Cherry-picked into main as d4315922..e5055d6d. Thanks!

Pull request closed

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