victory.exe: load the D3D12 Agility SDK from .\D3D12\ #2460
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2460
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2460"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lhnizdo on GitHub · 2026-11-25 14:00 UTC · original
lhnizdo:pr/agility-sdk→main· +56 −0 · 3 files · 3 commits · openOn Windows 10 the D3D12 runtime in System32 refuses root signatures with the directly indexed heap flags (
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED, 0xC00) that translated shaders need. On a Windows 10 22H2 machine (build 19045) with an NVIDIA card, every root signature was refused ("Unsupported bit-flag set (root signature flags c01)", 196 times), nothing drew, and the title crashed about 18 s in.victory.exenow exportsD3D12SDKVersion(620) andD3D12SDKPath(.\D3D12\). Windows then loadsD3D12Core.dllfromD3D12\next to the exe, instead of the System32 runtime. Rust does not export statics from an executable, soapps/victory/build.rsadds the/EXPORTlinker arguments (MSVC targets only).Without the folder, Windows keeps its own runtime, so machines where
mainalready runs are unaffected.Setup: take
build\native\bin\x64\from the Microsoft.Direct3D.D3D12 NuGet package, version 1.620.x (tested with 1.620.2). CopyD3D12Core.dll, plusd3d12SDKLayers.dllfor the debug layer, intotarget\<profile>\D3D12\. I haven't added the DLLs or a download step to the repository; tell me if you'd like either, or a README section.Checked on that machine: root signatures are taken, the title draws, and the D3D12 debug layer works through
d3d12SDKLayers.dll.🤖 Generated with Claude Code. The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a
Co-Authored-By: Claudeline.victory.exe exports D3D12SDKVersion (620) and D3D12SDKPath (".\D3D12\"), so Windows loads D3D12Core.dll from the Microsoft.Direct3D.D3D12 1.620.x NuGet package (build\native\bin\x64\, with d3d12SDKLayers.dll) placed in target\<profile>\D3D12\, instead of the System32 runtime. Rust does not export statics from an executable, so build.rs adds the /EXPORT linker arguments (MSVC targets). Without the folder Windows keeps its own runtime. On a Windows 10 machine (NVIDIA, wave32) the System32 runtime refused root signatures with the directly indexed heap flags (0xC00) our translated shaders need, so nothing drew; with the Agility SDK the menus run at 30 fps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018sSQTeDQ6Kc6DEkgPbAww8 (cherry picked from commit 2959665e6d87306200277ecdda222cc71b35280d)@kotekompotek on GitHub · 2026-11-25 14:12 UTC · original
The mechanism is the documented one (exe export table + app-local
.\D3D12\), and theCARGO_CFG_TARGET_ENVgate keeps GNU builds compiling — but two caveats from testing in this area:x86_64-pc-windows-gnuthis silently does nothing:/EXPORT:is unsupported by GNUld(same wall #486 hit —rustc-link-argwith a.deffile is the GNU path, orrustc-link-arg-bins+.def). Whatever ships should either emit the.deftoo or be explicit that the feature is msvc-only.victory.exeonly. #2429'sID3D12DeviceFactoryroute covers the same app case plus test binaries and, crucially, the title-facingd3d12_xs!serializers (the title's own root signatures carry the same flags the system runtime refuses — an export-loaded SDK does not re-route aGetProcAddress("d3d12.dll","D3D12SerializeRootSignature")lookup, which still resolves to the system serializer). If #2429 lands, this becomes redundant for device creation; if a minimal app-only change is wanted first, this is the clean version of that.@lhnizdo on GitHub · 2026-11-25 14:46 UTC · original
Thanks. You're right about GNU:
/EXPORT:only works with MSVC's linker. I've pushed a commit that makes it explicit: a Windows build for a non-MSVC target now prints a cargo warning that the Agility SDK isn't exported and Windows' own runtime will be used. I can't testx86_64-pc-windows-gnuhere, so I didn't add a.defpath I couldn't verify.On #2429: agreed that the
ID3D12DeviceFactoryroute covers more (test binaries, and the title's own serializer lookups). If #2429 lands, this one is redundant for device creation, and I'm happy for the owner to pick that one. This is the minimal app-only version, tested on Windows 10 22H2 with an NVIDIA card, where nothing drew without it.@Marvisak on GitHub · 2026-11-25 15:56 UTC · original · edited 2026-11-25 18:46 UTC
Automated triage for the maintainers.
Needs the maintainer's decision. This adds
apps/victory/build.rs(linker/EXPORTarguments, MSVC targets only, a cargo warning on other Windows targets) and makesvictory.exeexportD3D12SDKVersion(620) andD3D12SDKPath(.\D3D12\) inapps/victory/src/main.rs, so Windows loadsD3D12Core.dllfrom that folder when it is there. Triage does not recommend build-script changes or loading a separately obtained runtime DLL on its own. By reading, the exports have the shape Windows looks for (au32and a pointer to a NUL-terminated path), and without the folder nothing changes. CIcheckpasses.For the maintainer to weigh: the SDK version is fixed at 620 and must match the DLL users copy in, and #2429 (
ID3D12DeviceFactory) covers the same need more broadly, including test binaries and the title's own root-signature serializer lookups.On your reply: thanks, the new README section answers the setup and version points. What remains is the maintainer's call on the build script, the external DLL, and this versus #2429.
Generated by Claude Code
@lhnizdo on GitHub · 2026-11-25 18:07 UTC · original
Rebased onto current
main(13f91ca). On the triage points:@lerapeurdu62280-debug on GitHub · 2026-11-26 16:04 UTC · original
Test report on Windows 10 Pro 19045, AMD RX 6600 (Adrenalin 32.0.21045), with the Agility SDK 1.620.2 from NuGet (
D3D12Core.dllsigned by Microsoft). No game files:victory.exe translate --pipelines <empty folder>, which makes a host device first (Host::new(false)).victory.exeD3D12\folderD3D12\next to the exemain63bcca4the device supports SM 0x65 onlyed3a251)Error: … D3D12 SDK version configuration of the host executable is invalid(0x887E0003)0 emitted … 0 pipelines(no error)So the folder works as intended. But without it, the exe can no longer make any device. That contradicts "Without the folder, Windows keeps its own runtime" in the description and the code comment. It is the same loader behaviour found for the test binaries in #2878 (0x887E0003 on Windows 11), which #2878 fixed by exporting only when the runtime is staged. As it stands, this PR would break
victory.exeon every PC without the folder, Windows 11 included, wheremainruns today.For comparison, #2429 (runtime chosen at first use through
ID3D12DeviceFactory, no exports) on the same PC: device made with the folder, and without it the sameSM 0x65 onlyasmain, so no regression.AI-assisted: yes (Claude Code)
@DenRakEiw on GitHub · 2026-11-25 14:04 UTC · original · approved these changes
Verified against
origin/main(940d32f) on Windows 11:victory.exe(apps/victory/build.rs+main.rs) builds cleanly and passes allvictorytests.cargo test -p victory: 12/12 passed.cargo clippy -p victory --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 184 files ok.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 14:11 UTC · original · reviewed
Fifth Agility SDK PR — this one the cleanest mechanism: build.rs /EXPORT:D3D12SDKVersion,DATA + loading from .\D3D12. If the cluster converges, this export mechanism is the right core. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
@lhnizdo on GitHub · 2026-11-26 16:31 UTC · original
@lerapeurdu62280-debug, thank you, you're right. The
D3D12SDKVersionandD3D12SDKPathexports make the loader insist on the Agility runtime, so without aD3D12\foldervictory.execan't make a device at all (0x887E0003). The description's "Windows keeps its own runtime" is wrong. It's the same behavior we hit with the test binaries in #2878, and there a build-time check fixed it. For the exe that can't work: whether the folder is there only matters on the PC that runs it.#2429 picks the runtime at first use through
ID3D12DeviceFactory, with no exports, and by your table it behaves likemainwithout the folder and uses the folder when it's there. That's the right shape for this, so I'm happy to close #2460 in favor of #2429. I'll close it once #2429 is the way forward for the maintainers, unless someone wants something of #2460 kept.AI-assisted (Claude Code). No game data.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.