fix(agc): accept a CB metadata pass beside depth state without depth or stencil planes #4076
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4076"
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 boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-11T22:47:15Z.
What
DecodeColorMetadataPassrefuses a CB fast-clear eliminate or DCC decompress pass whileDB_DEPTH_CONTROLorDB_RENDER_CONTROLenables depth or stencil work ("CB metadata pass with depth or stencil work"). Vampire Survivors (PPSA21703) runs a DCC decompress pass on its results screen withDB_DEPTH_CONTROL = 0x700763left over from earlier draws, whileDB_Z_INFOandDB_STENCIL_INFOboth have format 0. No depth or stencil plane is bound, so the pass does no depth or stencil work, but the driver threw and the title aborted when the player pressed "Done".The pass is now accepted when no depth or stencil plane is bound (
depthPlanesAbsent) and still refused when one is. Without a plane the pass does not readDB_DEPTH_CONTROLorDB_RENDER_CONTROL, since they cannot change the outcome.metadataPassTestsadds the title's register values, the refusal once a Z or a stencil format is set, and a pass without planes that never wrote either control register.Bring-up notes: https://github.com/boykopovar/AnyPS5/discussions/3745#discussioncomment-18870563
Tested
Windows 11 Pro 10.0.22631, AMD Ryzen 7 7800X3D, AMD Radeon RX 7900 XTX, WinLibs GCC 15.2.0, Release.
main: "Done" on the results screen aborted with the error above. With the change the title returns to the stage map and keeps running.ctest -R agc_driver_graphicson7a84b2226: passes, and fails without the change.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T00:37:09Z.
The change is one predicate, and it is the one this file already applies:
depthPlanesAbsent()already exists here and is already the rule the draw path uses for exactly this reasoning — a depth or stencil test with no plane bound cannot do depth or stencil work (State.cpp:629,State.cpp:1091). The oldRequireasked whether depth work was enabled, not whether it could happen.Requirereduces to the old one exactly; acceptance widens only where both planes read format 0, and the added case pins both directions (DB_Z_INFOformat 0 accepted, format 3 refused).The helper's name reads wider than it behaves: it returns false when
DB_Z_INFO/DB_STENCIL_INFOare absent from the register block, not only when a plane is bound, so the new disjunct only applies when both registers were written with format 0 — conservative, and the same readingplaneTests()directly above it gives an unwritten register, though that helper treats the two registers independently where this one requires both present.One more thing worth flagging, since it's a second acceptance path this diff opens without a test for it: the
||short-circuits, soread(0x200)/read(0x0)are skipped wheneverdepthPlanesAbsent()is true. Before this change, a pass withDB_DEPTH_CONTROL/DB_RENDER_CONTROLnever written threw "missing register" (read()throws on an absent register); now it decodes instead, on the strength of the twoDB_*_INFOformats alone. Harmless today — nothing downstream of thisRequirereads depth/stencil state for a color-only pass — but it's a path the added test doesn't exercise, since the test only varies the Z-format axis; the stencil half of the predicate is never decisive either.The title's leftover
DB_DEPTH_CONTROL = 0x700763with both planes at format 0 is exactly the state the oldRequirerefused, which makes the added case the right regression.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-12T01:21:58Z.
Thanks. I added two cases to
metadataPassTests:DB_STENCIL_INFOformat 1) is refused, so the stencil half ofdepthPlanesAbsentnow decides a case on its own.DB_DEPTH_CONTROLandDB_RENDER_CONTROLnever written decodes.The second one is intended: with neither plane bound those two registers cannot change the outcome, so the decode should not require them. Reading them first would bring back
missing registerfor values that cannot matter.#2121 changes the line after this one (the resolve sample count), so whichever merges second needs a one-line rebase; neither depends on the other.
Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-12T05:59:18Z.
Hit the same abort on Windows with NVIDIA (RTX 4070 SUPER). The draw that threw was a non-indexed rect list, 4 vertices,
VGT_PRIMITIVE_TYPE7, withDB_DEPTH_CONTROL=0x700763andDB_RENDER_CONTROL=32, on the results screen "Done" flow. Checking that no depth or stencil plane is bound is cleaner than what I tried (matching the draw shape), and with a shape-based version "Done" stopped aborting on my side, so the cause lines up with yours.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T08:34:53Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL1090-1091