startup: decode slot 57 depth-stencil registers into a desktop state #2116
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2124"
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 R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T00:54:02Z.
Refs #1999
This is the decoder and device-free check offered for item A on #1999. The WARP depth read-back fixture and applying the decoded state to translated draws are left to the item A claimant.
State block A of a slot 57 pipeline holds the depth-stencil register words before the
CB_BLENDn_CONTROLwords of #1216:DB_DEPTH_CONTROLDB_STENCIL_CONTROLDB_STENCILREFMASKDB_STENCILREFMASK_BFThe positions were measured locally; no captured bytes are included. Other pipeline layouts are not covered.
src/startup_stubs/pipeline_state_decode.his a pure header:read_depth_stencil_wordsreads the four words and refuses a block that is too short.decode_depth_stencilreturns aD3D12_DEPTH_STENCIL_DESCand the stencil reference, using the field layouts and enumerations of Mesa'ssrc/amd/registers/gfx10.json(MIT).CompareFragmaps in order ontoD3D12_COMPARISON_FUNC.STENCIL_REPLACE_TESTmaps toREPLACE, and the add / subtract ops map toINCR(_SAT)/DECR(_SAT)only whenSTENCILOPVALis 1.ONES,REPLACE_OP, the logic ops, add or subtract by other than one) and colour writes tied to the depth result (DB_DEPTH_CONTROLbits 30-31).DEPTH_BOUNDS_ENABLE, and back-face masks or a back-face reference that differ from the front (D3D12 has one of each).Nothing in the draw path uses the header yet.
New test
tests/startup_pipeline_state_check.cpp, registered asstartup_pipeline_stateinCMakeLists.txtand described indocs/startup-runtime.md. It decodes hand-built register words for each compare function, each stencil op with a D3D12 form, the refusals and the flags, and a synthetic block. Negative control (WILL_FAIL):startup_pipeline_state_offset_controlplaces the words one word later in the block.Verification (branch head
97223879onmain246a875d, Windows 11 Pro 10.0.26300, MSVC 14.50, Visual Studio 18 Build Tools):100% tests passed, 0 tests failed out of 3. The check prints0 of 35 checks failed; the offset control reports2 of 35 checks failed, as expected.python -B tests/docs_links_check.py->Checked 18 Markdown files and 395 links.git diff --check main..HEAD-> clean.AI-assisted.