d3d12_xs: derived PSO overlays reach DEPTH_STENCIL2 and RASTERIZER1/2 (RT-STATE-PSO-OVERLAY-DS2-RS12) #2476
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2476"
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 Tyrannys on 2026-11-27T15:58:27Z.
Claimed in the coordination issue as: RT-STATE-PSO-OVERLAY-DS2-RS12 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7222238523)
What and why
Item 6 of @kevincommits'
RT-STATE-AUDIT-PIPELINEfinding in #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7221587976), part of #2464 Part B. Thanks for the audit.derive_stream(runtime/shims/d3d12_xs_pso_stream.cpp, device slot 55) patches a base PSO stream with records that carry D3D12 v0 descriptions: tag 0 aD3D12_DEPTH_STENCIL_DESC, tag 1 aD3D12_RASTERIZER_DESC, tag 5 the two stencil masks. These matched onlyDEPTH_STENCIL/DEPTH_STENCIL1andRASTERIZER. On a base that usesDEPTH_STENCIL2orRASTERIZER1/2, the derive failed asmissing_state.Those later versions have other layouts, so the record is converted, not copied:
DEPTH_STENCIL2: the depth fields and face ops are set, the record's one pair of masks goes on both faces, and the base'sDepthBoundsTestEnableis kept (as it already is forDEPTH_STENCIL1).DEPTH_STENCIL2: both faces' masks.RASTERIZER1:DepthBiasas a float. OnRASTERIZER2: the same, plusLineRasterizationModefromMultisampleEnable/AntialiasedLineEnable(QUADRILATERAL_WIDE,ALPHA_ANTIALIASEDorALIASED, as D3D12 maps them).DEPTH_STENCIL,DEPTH_STENCIL1andRASTERIZERare patched as before. Tags 2 and 3 are unchanged.Does not conflict with #2399 (VIEW_INSTANCING in the same files); checked with
git merge-tree.Tested
Windows 11, MSVC (VS 18), RelWithDebInfo, on
mainec91d695c.pso_stream_testgainstest_later_subobject_versions: bases withDEPTH_STENCIL2plusRASTERIZER1, andDEPTH_STENCIL2plusRASTERIZER2, take tags 0, 1 and 5, with every converted field checked. Withmain'sd3d12_xs_pso_stream.cpp, all 14 new checks fail (the derives returnmissing_state); with the fix, all checks pass, the old ones included.ctest -R "^(pso_stream|d3d12_mesh|d3d12_mesh_heavy_cache|xbox_depth_storage|d3d12_depth24_draw)$": 5/5 pass (d3d12_meshcovers slot 55 on a real layer device).scripts/check_no_game_data.py: clean.GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-27T17:15:03Z.
Independent Linux/Wine + NVIDIA check at head
bede0e73e(merged cleanly ontoorigin/mainc0201a806alongside#2480,#2478,#2477,#2474).7.2.15,wine-11.22,clang-cl+xwincross-build, NVIDIA GeForce RTX 3070 Ti 8 GB, driver620.73.04, Ryzen 7 5800X, 32 GB RAM. No game files.pso_streampassed (5.51 s) under Wine.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T18:40:49Z.
Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked.
Reading (marked):
Limits: one machine, one run for the PR, one run for each main witness.
AI-assisted (Claude Code, Claude Opus 5.5)
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:17Z.
Reviewed at head
bede0e73eon Windows 11 (MSVC 202219.44).Verification
pso_stream_test.pso_stream_test: passed.Notes (non-blocking)
DEPTH_STENCIL2andRASTERIZER1/2overlays, and tag-0/tag-5 mask propagation (d3d12_xs_pso_stream.cpp:49-99,185-257,438-463) all look solid.d3d12_xs_pso_stream.cpp:241-257;d3d12_vulkan_device.cpp:11070-11090): Tag 1 converts integerr.DepthBiastoFLOATin versioned rasterizers, which the Vulkan parser later converts back withINT(bias); forDepthBias = INT_MAX, rounding to2147483648.0foverflowsINT. Clamping against signedINTbounds in the Vulkan parser (pre-existing) would guard that edge case.Approve.
AI-assisted review + local MSVC verification.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T10:37:26Z.
Review: APPROVED
Reviewed
bede0e73eand verified the PSO stream and XS proxy mock tests.Code audit:
runtime/shims/d3d12_xs_pso_stream.cpp: derived PSO overlay tags 0 (DEPTH_STENCIL), 1 (RASTERIZER), and 5 (stencil masks) cleanly extend toDEPTH_STENCIL2,RASTERIZER1, andRASTERIZER2without corrupting subobject headers or trailing fields.pso_stream_testandxs_proxy_mock_testcover the new subobject variants.Verification (Windows 11, MSVC 19.44, Ninja Release):
pso_stream_testandxs_proxy_mock_test.ctest -R '^(pso_stream|xs_proxy_mock)$': 2/2 passed.python -I scripts/check_no_game_data.py: passed.AI-assisted (Antigravity, Gemini).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:52:12Z.
Red/green: On main pso_stream_test fails 15 checks (derived PSO overlays do not reach DEPTH_STENCIL2 and RASTERIZER1/2), and with the PR ctest -R "^pso_stream$" passes.
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:02:44Z.
Verified by OreoFR
c1ecf04ed+ PR headbede0e73e; green run in a merge package of 11 PRs, no new ctest failure vs mainctest -R "^pso_stream$"AI-assisted (Claude Code, Claude Opus 5.5).