Windows 10: load an Agility SDK runtime put in the D3D12 folder #21
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21"
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?
Imported from Zettrox/ztrx. Originally posted by wilu222 on 2026-11-25T03:26:45Z.
The README lists Windows 10 as supported, but Windows 10's inbox D3D12 runtime stops at shader model 6.5. There the title's root signatures (flags 0xc01) are refused (
root signature: Unsupported bit-flag set) and it crashes about 7 s after start (access violation at+0xb5a5f8). #16 got around it by patching in upstream VIctory's closed #175.This makes
victory.exeload Microsoft's Agility SDK runtime when one is put in the repository'sD3D12/folder (git already ignores*.dll):build.rsthen adds theD3D12SDKVersionandD3D12SDKPathexports the system'sd3d12.dlllooks for, and copies the folder's DLLs totarget/<profile>/D3D12/, socargo cleandoes not lose the runtime. It is the same opt-in as upstream's open #463, with two differences:D3D12SDKVersionexport, so anyMicrosoft.Direct3D.D3D12package works (#463 pins 614 and needs exactly 1.614.1).D3D12/folder is tracked (a README says what goes in it) and the script watches the folder, not the DLL. Cargo reruns a build script that watches a missing path on every build, which would relinkvictory.exeeach time for everyone without the runtime.Without the file the build is unchanged: no exports, the system runtime.
What is in it
apps/victory/build.rs(new): detects the runtime, reads its version, adds the exports, copies it beside the executable.D3D12/README.md(new): where the runtime goes.apps/victory/src/main.rs: the two exported statics, and a note on stderr when an opted-in build runs without the runtime beside it.crates/victory-pe/src/image.rs:ImageInfo::exported_u32, with a unit test on a synthetic image.apps/victory/Cargo.toml:victory-peas a build dependency (Cargo.lockunchanged).README.md: the Windows 10 step.Tested
main90b529f.mainas is: crash 7 s after start, as above.D3D12/: the build reportsusing the Agility SDK runtime 620;victory.exeexportsD3D12SDKVersion = 620andD3D12SDKPath→.\D3D12\. A 90 s run: boot screens and menus at 30 fps (2,048+ frames), no root signature refused, no crash,crashes.logunchanged. After the change to theD3D12/folder: a 60 s run, menus at 30 fps, no root signature refused, no crash.target/release/D3D12and runningcargo clean --release -p victory, then building: the runtime is copied back.cargo clippy --workspace --all-targets --locked -- -D warningsand the--all-featuresvariant: clean.cargo xtask policy --staged: ok.cargo test --workspace --locked --no-fail-fast: 474 passed, 23 failed, 7 ignored;mainon the same machine: 473 passed, the same 23 failed. They are GPU tests that find no shader model 6.6 device on Windows 10 (the test binaries do not opt in), pluscrash::tests::unwinds_like_the_system_walk, which fails intermittently on both.Not tested
[PR #21] Windows 10: load an Agility SDK runtime placed beside victory.exeto [PR #21] Windows 10: load an Agility SDK runtime put in the D3D12 folderImported from Zettrox/ztrx. Originally posted by Ekibunnel on 2026-11-25T04:42:06Z.
Your pr does what it say it does.
But hum... having the build touch the target folder is not a good thing.
as you said in the readme, a
cargo cleandeletes the folder so a :will just get rid of the files.
there is no real reason to check
target/<profile>/D3D12/D3D12Core.dllat build time.we should just check
D3D12/D3D12Core.dlluse that for the export and then copy it totarget/<profile>/D3D12/D3D12Core.dll.Imported from Zettrox/ztrx. Originally posted by wilu222 on 2026-11-25T04:57:09Z.
Good idea, just updated. The DLL now goes in a
D3D12/folder at the repo root (already git-ignored as*.dll), the build reads the version from there and copies it totarget/<profile>/D3D12/, socargo cleandoesn't lose it anymore. Retested: menus at 30 fps on Win10, and nothing changes when the folder is empty.Imported from Zettrox/ztrx. Originally posted by Ekibunnel on 2026-11-25T05:12:00Z.
tested
9e3ceececeand everything is working fine.Imported from Zettrox/ztrx. Originally posted by bailu12300 on 2026-11-25T06:04:05Z.
Confirming this works on Windows 10 19045 (build 19041's inbox
d3d12.dllis 10.0.19041.5794, so the title's SM 6.6 requirement is not met without it).What I did, at
90b529f, nothing else changed:D3D12Core.dll+d3d12SDKLayers.dll(1.614.0) intotarget\release\D3D12\apps/victory/src/main.rs, right after the//!block:build.rswith:Before this: crash at ~frame 64 (
0xc0000005 read 0x68), only 7 shaders translated,drawn=0.After this:
drawn=9382 dispatched=512, zero drops, 30 fps on the first-boot screens, and the prologue is reachable.Note
#[no_mangle]alone fails to link here (LNK2001 unresolved D3D12SDKPath/Version) unless the linker is told to export them, and from clause#[used]statics are not exported at all — theunsafe(no_mangle)+/EXPORTpair is what works. Might be worth putting one line about the Win10 path in README's Requirements.Imported from Zettrox/ztrx. Originally posted by futurepro62 on 2026-11-25T06:38:41Z.
Full-suite run, to go with Ekibunnel's and bailu12300's checks of the build above. Tested exact head
9e3ceec(on its base90b529f).Tested
rust-toolchain.toml), DXC + dxil.dll 1.9.2602.17, debug.cargo test --workspace --locked: 497 passed, 0 failed, 7 ignored (main90b529fon this machine: 496 passed, 0 failed, 7 ignored).cargo clippy --workspace --all-targets --locked -- -D warnings(the CI lint step): passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(the CI lint step): passed.an_exported_u32_is_read_from_the_file.Not tested
AI use
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.