fix(libSceAgcDriver): skip depth and stencil tests whose plane is absent #453
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/453"
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 SP4C3B4R-8 on 2026-10-03T11:18:52Z.
What
A draw can enable the depth or stencil test in
DB_DEPTH_CONTROLwhileDB_Z_INFO/DB_STENCIL_INFOdeclare the corresponding plane absent (format 0 /INVALID), for example a stencil test withALWAYSandKEEPon a depth-only surface. Such a draw was rejected with "stencil test without a stencil plane" (or "depth test without a depth plane"), so none of its depth writes happened either.The hardware behaves as if the test of an absent plane were disabled.
decodeDepthnow clears the test bits of an absent plane instead of throwing, and a draw whose planes are both declared absent is treated like a depth pass-through instead of being rejected byDrawRejection. A depth or stencil register that is missing entirely still goes through the existing checks.Tested
Windows 11, MinGW-w64 GCC 15.2.0.
agc_driver_graphics_testsandagc_driver_pm4_testspass on this branch alone;Graphics.cppchecks that tests on two absent planes are dropped and not rejected, and that a depth test without a depth plane is dropped while the stencil test of a present stencil plane is kept. With a retail title, about 13k draws per minute that write the main depth buffer are no longer skipped.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🤖 Generated with Claude Code
https://claude.ai/code/session_018m6Ad8zkQKPKZmyUQK9vfE
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:57:22Z.
This passed my PPSA21564 check, but it now conflicts with main after #376 and #294 merged. Could you rebase? Then it's ready to merge from my side.
Imported from boykopovar/AnyPS5. Originally posted by SP4C3B4R-8 on 2026-10-04T10:21:26Z.
Rebased onto main (
2cf901bc), now48ebf319. The only conflict was inDrawRejectionafter the depth-bounds change: I kept main's handling (0xbmask, "depth bounds without a depth surface") and only added the absent-planes check, which still applies to the depth and stencil tests (word & 3). Graphics and PM4 tests pass locally. Thanks for checking it against PPSA21564.Written with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T22:38:04Z.
Thanks for the rebase. Keeping main's
0xbmask and the depth bounds rule is right, and the commit is otherwise unchanged. My PPSA21564 check ran with the same rule (tests on an absent depth or stencil plane are dropped) and your test, and the full ctest passes here on current main. Ready to merge.