d3d12: serialize depth-plane root signatures explicitly #2591
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2591
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/d3d12-wine-depth-plane"
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?
Pull request successfully merged and closed
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.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.
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).
RUN of #2591 (native Windows, no Wine, no game files)
Heads: PR 5b3477768cafdbf0f3dfe3867e51089a6ae15642 (base = main 1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3, 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).
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).
RUN: PR #2591 re-run on current main (red/green)
Heads: PR 5b3477768, main 4364a4fa6. Merged locally with
git 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.
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).