Windows 10: load the D3D12 Agility SDK runtime (0 of 27,044 pipelines without it) #856
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!856
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-856"
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?
@gabrielfriasw on GitHub · 2026-11-25 10:48 UTC · original
win10-agility→main· +44 −0 · 3 files · 1 commits · closed without mergingWhy
On Windows 10, the in-box
d3d12.dllstops at shader model 6.5 and refuses every translated pipeline's root signature:0xc00=CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED(0x400) |SAMPLER_HEAP_DIRECTLY_INDEXED(0x800): the bindless flags every translated pipeline uses. The failure is atD3D12SerializeVersionedRootSignature, so nothing is drawn.Measured on this machine (Windows 10 22H2 19045, Ryzen 9 5900XT, RTX 3070, driver 32.0.16.2140) with
victory translate --pipelinesover the title's shader pack:The fork's test machine is Windows 11, where the in-box runtime already does this, so the fork never needed it. Windows 10 users get nothing at all.
What
apps/victory/build.rsexportsD3D12SDKVersionandD3D12SDKPathas data symbols (MSVC only).apps/victory/src/agility.rsdefinesD3D12SDKVersion = 620andD3D12SDKPath = ".\D3D12\".main.rskeeps both symbols alive.D3D12 reads these two symbols from the process executable and, when they name a runtime newer than the system's, loads
D3D12Core.dllfromD3D12SDKPathrelative to the executable.Getting
D3D12Core.dllThe DLLs are Microsoft's, so they must not enter the repository (upstream's asset policy, and this fork inherits it). They are the
Microsoft.Direct3D.D3D121.620.2 NuGet package — the minor version is the number exported above:build/native/bin/x64/D3D12Core.dllandd3d12SDKLayers.dllgo totarget\<profile>\D3D12\. Acargo xtasksubcommand could do the fetch; I left it out of this PR to keep the diff to the load path — say if you'd rather have it included.Tested
Windows 10 22H2, RTX 3070, real title, this branch on top of
f85101b:D3D12\reproduces the flags-c00 failure, so the effect is the runtime and not something else in the branch.I have not tested Windows 11: the folder is absent there and the in-box runtime is used, which is the previous behaviour.
Notes
victory.exeonly; no other crate is touched.victory.lib/victory.expnext to the exe; harmless, and cargo reports it as alinker_messageswarning.AI-assisted: written with an agent that ran everything above on the machine described.
Windows 10's in-box d3d12.dll stops at shader model 6.5 and refuses root signatures that index the descriptor heaps directly (flags 0x400, 0x800), which every translated pipeline uses: Unsupported bit-flag set (root signature flags c00) Measured here (Windows 10 22H2 19045, RTX 3070): without the runtime `translate --pipelines` makes 0 of 28,164 pipelines and refuses 27,044; with it, 23,034 are made and 3,607 come from the library. victory.exe now exports D3D12SDKVersion = 620 and D3D12SDKPath = ".\D3D12\", and D3D12 loads D3D12Core.dll from that folder beside the executable when it is newer than the system's runtime. The DLLs are Microsoft's and never enter the repository: they are the Microsoft.Direct3D.D3D12 1.620.2 NuGet package (SHA-512 d683ff7f...693032735), unpacked into target/<profile>/D3D12/. Windows 11 keeps its in-box runtime, and a missing folder changes nothing.@HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original
Tried on Windows 10 22H2 / RX 7900 XTX, merged on main
d510ee4, debug build ofvictory. As a probe I usedvictory translate --pipelines <empty folder>, which creates the D3D12 device and checks SM 6.6 (Host::new):D3D12Core.dllbeside the exe:the device supports SM 0x65 only, as expected without the exports.D3D12Core.dll1.620.2 intarget\debug\D3D12\: the device is created, exit 0. dumpbin shows both exports.D3D12\folder:D3D12CreateDevicefails,"La configurazione della versione di D3D12 SDK dell'eseguibile host non è valida"(Italian locale: the host exe's D3D12 SDK version configuration is invalid, the0x887E0003/D3D12_ERROR_INVALID_REDISTI hit on #69). So on Windows 10 a missing folder doesn't keep the in-box runtime, asagility.rssays. It fails earlier, with a less clear message than main's. I didn't test Windows 11.This overlaps #402, which makes the same exports only when the runtime is present and adds
cargo xtask agilityto fetch it. Also, the new files still carryLOCAL-ONLY (… never pushed)comments.@LeonardoS11 on GitHub · 2026-11-25 23:08 UTC · original
Two results for this, one for and one to watch out for.
Windows 10 — it is what makes the title run. A second machine, RTX 5070 Ti 16 GB, Ryzen 7 7700X, Windows 10 Pro 19045, NVIDIA 32.0.16.2140. Without this PR: 6 launches of 6 ended 4 to 7 seconds in with
0xc0000005at+0xb5a5f8, after "root signature: Unsupported bit-flag set (root signature flags c01)" and "host root signature refused … 0x80070057" for the pipelines. With this PR merged (on9c184b3with other open PRs) and the two DLLs ofMicrosoft.Direct3D.D3D121.620.2 inD3D12\: no refusal of that kind, the boot and loading screens show, the world is black while the pipelines are still being made on the first launch and complete after it, and the first room in the Series S profile runs at about 113 ms a frame — the same as an RTX 3080 Ti on Windows 11 with the same build.Windows 11 — the same executable needs the folder too. The description says that without
D3D12\the in-box runtime is used. On Windows 11 build 26200 here (in-box D3D12Core 10.0.26100) that is not what happens: 7 launches of 7 of an executable with these exports and noD3D12\beside it ended at start-up with0x887E0003isD3D12_ERROR_INVALID_REDIST: the exports ask for SDK version 620, the in-box runtime is older, and with no redistributable to load the device is not made. With the folder copied beside the executable the same build starts. So once this is in, a build without the DLLs would stop working on Windows 11 machines whose in-box runtime is older than 620 — worth either a line in the README, a start-up message naming the missing folder, or making the version a build option.(Runs on two machines of ours; read from the logs and written with Claude Code.)
@LeonardoS11 on GitHub · 2026-11-25 23:15 UTC · original
Following up on the Windows 11 failure above with something that fixes it, in case you want it in this PR: commit 41b0841 in
LeonardoS11/victory-fork(branchport/v11-sections; 78 lines inapps/victory/build.rs,agility.rsandmain.rs, on top of this PR).With it the same executable runs with and without the folder. Checked on Windows 11 build 26200, RTX 3080 Ti, by the module list of the process:
D3D12\beside the executable:C:\WINDOWS\SYSTEM32\D3D12Core.dllis loaded, the device is made, the title goes on;…\D3D12\D3D12Core.dll(1.620.2) is loaded.The launcher says on stderr which one it used. Two things were needed:
D3D12SDKVersionis a mutable static, andmainsets it before anything touches D3D12. Setting it to 0 does not work — D3D12 answers with the same0x887E0003. What works is the in-box runtime's own version: it is read from the export table ofSystem32\D3D12Core.dllas a file, without loading it (616 here), and written to our export when there is no.\D3D12\D3D12Core.dll.d3d12.dllhas to be delay-loaded (/DELAYLOAD:d3d12.dllplusdelayimp.lib). As a static import it is loaded with the executable and reads the exports beforemainruns.Not covered: a system with no
System32\D3D12Core.dllat all keeps 620, so there the folder stays required, as now. Tested with launches of 12 to 15 seconds each way, not a full session.(Written and tested with Claude Code on the machine above.)
@HAL9000RELOADED on GitHub · 2026-11-26 16:32 UTC · original
@LeonardoS11 your 41b0841 on Windows 10, cherry-picked on this PR's
2aaf3ff: RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045), debug build (a release build of 41b0841 gives the same). Probe:victory translate --pipelineson an empty folder (it only makes the device).D3D12\beside the exe2aaf3ffaloneD3D12_ERROR_INVALID_REDISTWindows 10's
System32\D3D12Core.dllhere (10.0.19041.5794) exportsD3D12SDKVersion = 2, so your read-the-system-version path covers Windows 10 too, not only Windows 11. The folder is still needed there in practice: without itvictorystops atthe device supports SM 0x65 only, with no hint aboutD3D12\, so a pointer to it in that error would help.AI-assisted (Claude Code): tests run on my machine, text drafted with Claude.
Pull request closed