d3d12: serialize depth-plane root signatures explicitly #2591
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2591"
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 ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-28T20:31:48Z.
Claimed in the coordination issue as: D3D12-WINE-DEPTH-PLANE
What and why
Wine's HLSL compiler ignores the
RootSignatureattribute, so the depth-plane pass cannot create a root signature from the compiled pixel shader. The pass then leaves the depth plane untouched.Serialize a v1.1 root signature explicitly for both depth-plane shaders. The existing pixel-visible SRV at
t0retains its visibility and descriptor flags. The existing GPU regression test serializes its singleb0draw constant explicitly too, so it can exercise the original texture readback assertions under Wine.Tested
leonida-gpulibrary tests withcargo xwinin thediagprofile.a_depth_planes_twin_is_drawn_into_the_planefails on baremainat1bc055e6cwith zero descriptor heaps instead of one. It passes with this change, including the per-list heap and depth readback assertions.git diff --checkandscripts/check_no_game_data.py. It also applies cleanly on top of #2577 at32ae9bf82.main(4364a4fa6) with an RTX 3090, NVIDIA driver 621.40 and MSVC. All three focused checks passed. Restoring only the old production root signature reproduced the zero-descriptor-heap assertion. The full library suite reported 544 passed, 0 failed and 47 ignored on both trees. Retest by enlight3dGPUs tested: Desktop NVIDIA GeForce RTX 4070 SUPER (12 GiB, profile M), NVIDIA 620.73.04, CachyOS (kernel 7.3.6-3), Wine 11.22, vkd3d-proton
71cae091, DXVK DXGI 3.1.1.AI-assisted: Codex.
Checklist
mainat1bc055e6c.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-28T20:42:23Z.
The fork workflows are awaiting maintainer approval. I ran the full-tree No Game Data check locally on
5b3477768, and it passed.I also ran the Linux semantic suite with SPIRV-Tools required on both this PR and bare
mainat1bc055e6c. Both ran 6,484 tests in 522 files and reported the same twoclampsubtest failures in the single filetest_valu_cvt_f16_int16_mods.py. That baseline issue already has an owner. Existing coordination claim CI runCombined Linux check with #2577. I merged
7ff494f3cand this PR's5b3477768intomainataa918e5d9and built the Windows runtime and GPU tests with cargo-xwin in profilediag. On CachyOS, Wine 11.22 and a physical RTX 4070 SUPER (620.73.04), all four synthetic GPU tests passed offline. They covered the scaled premultiplied compositor readback, the depth and stencil plane readbacks, and the depth twin round trip. I replaced the early fixture returns with assertions in the local test build so lack of a host device or required resource twin fails the test. The combined tree also passed the No Game Data check.AI-assisted with Codex.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:55:30Z.
Review: COMMENTED
Reviewed
5b3477768againstmain1bc055e6c. The explicit v1.1 signatures preserve the pixel-visible SRV at t0 for the two plane shaders and the one 32-bit constant at b0 for the fixture.The exact PR's
a_depth_planes_twin_is_drawn_into_the_planepassed on native Windows 10 22H2 (19045) with RTX 5070 (610.88), profilediag, MSVC target. For the A/B I made the two early returns in the draw fixture hard assertions in local copies, requiring a real host device and a depth twin. The draw/readback and depth-twin round-trip both passed on main and on the PR. This independently checks native D3D12 compatibility; the Wine regression is covered by the author's run. The pair with #2577 also merges cleanly ingit merge-tree.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-28T21:12:50Z.
Native Windows regression check for
5b3477768cafdbf0f3dfe3867e51089a6ae15642against parent1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3. Windows 11 build 26340, RTX 3080 selected throughLEONIDA_ADAPTER(driver 630.20), pinned Rust 1.98.1 MSVC,diagprofile, Rustleonida-gpulibrary tests.Both revisions passed the depth-plane GPU readback, the stencil-plane GPU readback, and the depth/stencil footprint check (3/3 each). I used the same local fixture-only guard on both revisions to require native D3D12 device initialization. The device-initialized marker printed for both GPU tests on each revision before their readback assertions passed.
This covers native Windows parity for the explicit root signature change. The Wine result is covered separately by the author's report. Synthetic textures. AI-assisted (Codex).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:47:27Z.
RUN of #2591 (native Windows, no Wine, no game files)
Heads: PR
5b3477768c(base = main1bc055e6c2, so no merge needed).Machine: NVIDIA GeForce RTX 3090 24 GB, driver 621.40, Windows 11 Pro 10.0.26300, rustc 1.98.1.
Command (in d3d12/, filters after the separator because cargo takes one name before it):
cargo test -j 8 -p leonida-gpu --lib -- a_depth_planes_twin a_stencil_planes_twin depth_stencil_footprints
Not checked here: the real Wine / vkd3d-proton run (needs Linux).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T01:08:00Z.
Review: COMMENTED
Static audit of
5b3477768against48bae6cad. No findings.The explicit v1.1 signatures match the depth shaders' pixel-visible
t0binding and the fixture's singleb0constant. The supplied results cover the R16 depth readback on Wine and native Windows. The float variant shares the same table layout and has no dedicated depth readback in the supplied tests.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T10:36:43Z.
Thanks for pointing out the missing float readback. I tested the public PR head
5b3477768on main5844b6481with the separate synthetic float-depth fixture applied.The integer and float depth-plane readbacks, stencil-plane readback, and depth-twin round trip passed on both the RTX 4070 SUPER (NVIDIA 620.73.04) and Radeon 610M (RADV 26.3.1), under Wine 11.22 on CachyOS with VKD3D-Proton
71cae091. I then restored the old shader-derived root signature in the production integer and float passes while keeping the same fixture. Both depth tests failed on each GPU at the descriptor-heap assertion (zero heaps, one expected), before readback.The fixture uses synthetic textures. The No Game Data scan of the two changed files and the diff check passed. AI-assisted with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T17:53:48Z.
RUN: PR #2591 re-run on current main (red/green)
Heads: PR
5b3477768, main4364a4fa6. Merged locally withgit merge --no-ff(clean, only host.rs and resource.rs touched, nothing pushed).Command (d3d12/, MSVC target, vcvars64):
cargo test -j 8 -p leonida-gpu --lib -- a_depth_planes_twin a_stencil_planes_twin depth_stencil_footprintsCreateRootSignature(0, &ps[..]), tests kept): behavioural failure.a_depth_planes_twin_is_drawn_into_the_planefails at the per-list heap assertion (left: 0, right: 1: no descriptor heap is set), the symptom seen under Wine. The other two still pass. Restored afterwards.cargo check -p leonida-gpu --testson the merged tree: clean (warnings only).--libsuite: merged tree 544 passed, 0 failed, 47 ignored; plain main 544 passed, 0 failed, 47 ignored. No difference.Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 (native D3D12).
Not checked: Wine/vkd3d-proton.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:59:43Z.
Merging. Head
5b3477768has red/green verdicts from reviewers other than the author (above), merges cleanly withmain3be7be011, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).