Build: export D3D12SDKVersion and D3D12SDKPath from GNU targets #1903
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1903
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1903"
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?
@wzl271 on GitHub · 2026-11-29 02:07 UTC · original
wzl271:gnu-d3d12-exports→main· +24 −6 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCFixes #1899
What it changes
apps/victory/build.rsadded/EXPORT:D3D12SDKVersion,DATA,/EXPORT:D3D12SDKPath,DATA,/DELAYLOAD:d3d12.dllanddelayimp.libonly whenCARGO_CFG_TARGET_ENV == "msvc". Those are MSVC linker switches; a GNU linker has neither, so anx86_64-pc-windows-gnubuild shipped an empty export directory, Windows never read a version from the executable, and every start asked its own Direct3D 12 for shader model 6.6 — which Windows 10's stops at 6.5, so the title was refused before a frame was drawn:The MSVC arm is untouched. The other arm writes
victory-exports.defintoOUT_DIRand hands it to the linker as an input; exporting the two names also keeps them from--gc-sections.d3d12.dllstays a normal import there, so it is loaded beforemainand reads the 614 the static starts with — which is what theD3D12folder beside the executable holds. Delay-loading it on GNU as well would be the better long-term shape if someone drops a different Agility version in place; not done here to keep this to the defect.How it was tested
GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RX 7900 GRE 16 GB, Series X 2560x1440, DLSS off, frame generation off, no ray tracing; Windows 10 19045; Adrenalin 32.0.32029.2010; GTA6 930.048.020-vb_sub_story (Series X dump)
Build: rustc 1.100.1
stable-x86_64-pc-windows-gnu, MinGW-W64 gcc 16.2.0,cargo build --release --locked -p victory --target x86_64-pc-windows-gnuBefore: exits with the error above, no window, no log beyond the first line
After:
objdump -p target/x86_64-pc-windows-gnu/release/victory.exelistsD3D12SDKPathandD3D12SDKVersionin the export table, and the run logsthen loads and renders the intro (this build is
main, which crashes later for an unrelated reason — see #1900, it is not this change)For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a, build script only
cargo testpassed for the crates it touches: yes —cargo test -p victory --locked --target x86_64-pc-windows-gnu→ 29 passed, 2 passed, 0 failed.cargo clippy -p victory --all-targets --no-deps -- -D warningsreports no error frombuild.rs(the warnings it does print come from this machine's newer 1.100.1 than the pinned 1.98.1, and from other crates).Checked for overlap
d3d12.dllthe game ends up with at run time, not the exports the build script asks the linker for; nothing else touchesapps/victory/build.rs.Both are exported for MSVC only: `/EXPORT:` and `/DELAYLOAD:` are its switches. A GNU linker has neither, so its executable's export directory stays empty, Windows never reads a version, and every start asks its own Direct3D 12 for shader model 6.6 — which Windows 10's stops at 6.5, and the game is refused before a frame is drawn: Error: this PC's Direct3D 12 runs shader model 6.5, and the game needs 6.6 A module definition file gives GNU ld the same two exported names (DATA, or the linker is free to find them unneeded and `--gc-sections` drops them). `d3d12.dll` is imported the usual way there, so it loads before `main` and reads the 614 the static starts with, which is the version the `D3D12` folder beside the executable holds. Tested with rustc 1.100.1 stable-x86_64-pc-windows-gnu and MinGW-W64 gcc 16.2.0 on Windows 10 19045: `objdump -p` lists both names after the change, and `host shader model model=6.8 runtime=...\D3D12\D3D12Core.dll` appears in the log where the title used to be refused.@ANDREANIADS on GitHub · 2026-11-29 02:17 UTC · original
For a regression check at
7ef182e, the GNU build could require both exact names in the export table of the linked PE. I tested this on Linux with one synthetic x64 COFF object defining both data symbols and GNU ld 2.44 (-mi386pep --gc-sections). Checking the named rows ofobjdump -ppassed with both.defentries, reported both names missing without the.def, and identified exactly the missing name when either entry was omitted. The same four controls passed with LLD using MSVC-style/EXPORT:name,DATAswitches. The check allows unrelated exports. It inspects names only; the PEs were never run, and Microsoft’s linker and the D3D12 runtime were outside this test.[pr-fix] Build: export D3D12SDKVersion and D3D12SDKPath from GNU targetsto Build: export D3D12SDKVersion and D3D12SDKPath from GNU targets