fix(agc): storage access to a depth surface's stencil plane through its stencil aspect #2325
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2325"
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 fisherjoey on 2026-10-09T15:33:06Z.
What
Storage-image access to a depth surface's stencil plane. #425 handles the depth plane through
Transferand a writer. This change extends that model to the stencil aspect:Transfertakes an aspect. The stencil plane needs an 8-bit storage format and a single layer; anything else still throws.DepthSurfacekeeps a stencil writer next to the depth one, andTakeWritesandApplyFastClearhandle both planes.SeedStorageFromStencilseeds it, andcachedStorageTexturecalls it instead of throwing.Depends on #425.
The diff shows #425's commits until it merges, since GitHub can't stack a PR on a branch in another fork. Review
598f7883only. #1684 and #1842 also add stencil storage, againstmainand in a different way, so only one of the two approaches should land.Tested
Linux (Nobara 44, kernel 7.2), GCC 16, RTX 5070 Ti with NVIDIA 595.91.07, and RADV.
agc_driver_stencil_plane_storage: a draw writes stencil 0x5a, a computeimage_loadmust return 0x5a, then a computeimage_storeof 42 must make stencil EQUAL 42 pass everywhere and EQUAL 0x5a nowhere. Fails on #425's head withstorage access to a depth surface's stencil plane is not implemented; passes with this change. #425'sagc_driver_depth_fast_cleartests pass.ctest -R agc_ -j1: 227 of 227 on the RTX 5070 Ti and 227 of 227 on RADV (Ryzen 5 7600X iGPU, Mesa 26.2.1).tools/check_conventions.py --base 62b1e552: passes.Checklist
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T16:31:59Z.
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/Execution/include/Pm4.hppL142core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferFill.cppL4, L203core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cppL7, L58core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppL17-18core/libs/prx/libSceAgcDriver/Graphics/include/State.hppL65, L154-155core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL38, L107, L151-152, L155, L172core/libs/prx/libSceAgcDriver/tests/Graphics.cppL6, L710, L724core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cppcore/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hppcore/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppL17-18core/libs/prx/libSceAgcDriver/Graphics/include/State.hppL65, L154-155core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL12-13, L152-153, L155docs/dev/TechnicalDebt.mdL235Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T17:53:08Z.
Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at
598f7883:/tmp/anyps5_build) with zero warnings/errors.python3 tools/check_conventions.py --base origin/main --head HEAD-> PASS (0 errors).PacketMemory.cpp. Tested cleanly across Vulkan pipeline.LGTM!
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T18:09:22Z.
I missed #2076 when I opened this. @jdmagic opened it nine hours before this one, and it does the same thing: both stack on #425 and route a storage T# at a depth surface's stencil plane through
Transferwith the stencil aspect (SeedStorageFromStencil,DepthStencilPlaneAt, a stencil writer next to the depth one). Most of the stencil code is identical.#2076 came first, so that's the one to review. This PR adds two things on top of it:
decodeDepthreads the HTILE address and whether HTILE holds stencil state (TILE_STENCIL_DISABLE), and a whole-HTILE fill with SMem 0 clears the stencil plane (HtileFillClears,HtileFillCovers).agc_driver_stencil_plane_storage: a draw writes stencil 0x5a, a computeimage_loadmust read 0x5a, and animage_storeof 42 must make stencil EQUAL 42 pass. It fails on #425's head and passes here.I can't open a follow-up PR on top of #2076 (new PRs from me are closed by intake for now), so I'm closing this one. Both parts are in commit
598f7883on fisherjoey/AnyPS5fix/agc-stencil-plane-storage, on #425's head62b1e552. @jdmagic, feel free to cherry-pick either part into #2076.AI-assisted: yes
Pull request closed