fix(agc): keep PS4 depth planes coherent with buffer reads of their memory #9895
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9895"
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 savvaniss on 2026-10-22T20:49:38Z.
What
Get-fix/AnyPS5#20, moved upstream as Get-fix asked. #9431 is on
mainnow, so this PR's diff is only the change below.A depth surface keeps its depth in a Vulkan image. #7154 keeps a depth plane coherent with buffer reads and writes of its memory:
GuestBuffersV#, an image lookup or a pending-store flush overlaps it;It only takes single-sample 32-bit planes with the PS5's 64 KiB Z swizzle (
SW_MODE24). A PS4DB_Z_INFOnames a GB_TILE_MODE index, not a swizzle mode. So a PS4 plane never took part, and a buffer read of it saw whatever guest memory held.Risk (CUSA03312) reads its depth that way in every board frame. On the Hasbro experiment stack (test/ps4-stubs, RX 9070 XT) the frame does this:
DB_RENDER_CONTROL = 0x60over the scene depth: 2048x1152D32_SFLOAT_S8_UINT,DB_Z_INFO = 0xa0000003, so tile index 0 (Depth2D64);ACQUIRE_MEMwithCP_COHER_CNTL = 0x84c44000(DB action) over the scene plane and over a second 9 MB buffer;DISPATCH_DIRECT 0x2400 x 1 x 1, which is 9,216 groups of 64 threads at 16 bytes each. It copies the 9,437,184-byte plane into the second buffer with buffer loads and stores;The copy carried stale memory, so the whole board was out of focus. Menus and 2D screens were sharp. Monopoly Plus, in the same pack, reads its depth through a T# smaller than the padded plane; that view reaches this PR's store through #7154's image-lookup flush (see Tested).
This PR:
DepthTarget::gcnTileMode. It takesDB_Z_INFOTILE_MODE_INDEX(bits 22:20) and maps it as the T# decode maps a tiling index (GcnTileMode, a public wrapper of the existingresolveGcnTileMode);DB_DEPTH_SIZE's pitch asgcnPitch. The store, reload and stale-range code is #7154's, unchanged;sizeof(State)guard inPipelineJournal.cppfrom 920 to 928.CanonicalPipelineStateand the recipe codec keep only the depth target'sformatandsamples, so the new field never reaches a recipe.PS5 planes are unchanged.
Since #9026 a plane is stored in 64 KiB units. A PS4 plane is tracked as one unit (
SizeUnits), so it is stored and reloaded whole. With 64 KiB units, the Depth2D256 case below left the texels past its first unit unstored, even with a read in every unit. A debt entry of its own says so. D16, stencil and multisampled PS4 planes still keep depth in the host image only.main's stencil store (#12210) needs the PS5 swizzle inStencilMirrorable, so it does not take a PS4 plane.Source for
TILE_MODE_INDEX. Nothing here is an AMD statement about Liverpool or a console measurement:DepthBuffer::GetTileModereads the index, and its depthImageInfouses it.DepthRenderTarget::getTileModereads the same field.TILE_MODE_INDEXat bits 22:20 ofDB_Z_INFO, the bits this reads.DB_DEPTH_INFO's array mode and macro-tile fields instead. So the register list doesn't show that Liverpool's DB uses the index.DB_DEPTH_INFO.This code does not read
DB_DEPTH_INFO, so a title whose two registers disagreed would be stored in the index's tiling. The debt entry records that.#9672 (Get-fix/AnyPS5#9 upstream) adds
DepthTarget::gcnnext to the new field. The two compose, and whichever lands second rebases a neighbouring line and recomputes the guard.Tested
Return to a tiling, 2 Nov. Head
c72cf633cd, test-only. oneandonlydean's review: going back to a tiling whose surface still exists.TileModeSwitchnow binds the first tiling again without writing and compares a draw at 0.5 under LESS with the plane's bytes in that tiling, on a new surface and on a reused one (a sampled texture held across the switch,DepthSurfacesSerialunchanged). No driver change was needed. Removing theSyncFromMemorycall on that bind, hiding the store from the reused surface, or removing the store each fails it at its own check (see the thread).agc_driver_gcn_depth_plane_buffer_memorypasses, 1 of 1 on the RX 9070 XT, noVUID-line. Not rerun: the other 34 tests of the 1 Nov run (no driver code changed), the same test onmain, the flip tests, Linux, games.Tile-mode switch, 1 Nov. Head
55f884b209(0b365d9926plus a shorter debt entry). oneandonlydean's review: a surface reused across a tile-mode change stored in its old layout.agc_driver_gcn_depth_plane_buffer_memorygainsTileModeSwitchon one 512x256 allocation, Depth2D64 then Depth2D256 and the reverse. Removing the tile compare, the store at the switch or the reload each fails it at its own check (see the thread). 35 of 35 pass once on the RX 9070 XT:agc_driver,agc_driver_pm4,agc_driver_graphics,agc_driver_gcn_detile,agc_driver_gcn_depth_plane_buffer_memory,agc_driver_resource_cache_replaced_textureand everyagc_driver_depth_*test, noVUID-line. Not rerun: the same set onmain, the flip tests, Linux (no struct under the size guards changed), games.Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004),
ANYPS5_GPU=AMD.Merge of
mainde83e8f270, 31 Oct. Head5d1381c40e. The only conflict was indocs/dev/debt/libSceAgcDriver.md: both sides kept.agc_driver_gcn_depth_plane_buffer_memory,agc_driver_depth_fast_clear_submitandagc_driver_graphicspass, 3 of 3 on the RX 9070 XT, noVUID-line. Not rerun: the other tests, Linux (mainchanged no struct under the size guards in this merge), games.Base. This branch is now
853389c92c:main5b913d40c6merged in (d8a0a2734b), then the guard bump, the decode test and a debt line. Every file #9431 touched takesmain's version.git diff 5b913d40c6 853389c92cholds only this PR's ten files.git merge-treewithmaind2250771abhas no conflicts; that merge was not built. The Windows and Linux runs below were on4c37f8af0c;853389c92cadds one debt sentence to it.New
agc_driver_gcn_depth_plane_buffer_memoryruns a Depth2D64 and a Depth2D256 PS4 target, each two macro tiles wide and high (512x256 for Depth2D64):The test harness gains an optional GCN tile mode on
Surfaceand an optional scissor inDrawOptions.New
GcnDepthTileModeTestsinagc_driver_graphicsdecodesDB_Z_INFOthroughDecodeState:0xa0000003withDB_DEPTH_SIZEfor 2048x1152 gives Depth2D64 at that size, index 2 gives Depth2D256, index 7 gives DepthPrt1K, the field above the index changes nothing, a PS4 surface with no depth plane stays unset, and a PS5DB_Z_INFOstays unset.Revert checks on
4c37f8af0c, one rebuild each. Each test fails as shown and passes again with the files restored:DepthSurface.cpp,GuestTextureResource.cppandState.cppas on5b913d40c6, headers keptagc_driver_gcn_depth_plane_buffer_memorygcnTileModetest inSizeUnits(one-unit rule)agc_driver_gcn_depth_plane_buffer_memoryState.cppagc_driver_graphicsagc_driver_graphicsagc_driver_graphicszFormat != 0testagc_driver_graphicsif (gcn)scope (PS5 decode also takes the index)agc_driver_graphicsValidation layer: run with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest -V, onmain5b913d40c6and on this branch. The tests:agc_driver_gcn_depth_plane_buffer_memory,agc_driver,agc_driver_pm4,agc_driver_pm4_replay,agc_driver_graphics,agc_driver_register_key,agc_driver_gcn_detileandagc_driver_pattern_buffer_fillagc_driver_flipand the 17video_out_flip_*modesagc_gcn_decode,texture_format_lookup,agc_driver_resource_cache_replaced_textureandagc_depth_copy_kept_bytesagc_driver_depth_*tests, among themagc_driver_depth_plane_buffer_memory,agc_driver_depth_fast_clearandagc_driver_depth_fast_clear_submitResults:
main: 58 of 58 pass (the new test is not onmain).VUID-line orwas not found but was requested by env var VK_INSTANCE_LAYERS. EverySelected GPUline names the RX 9070 XT (49 onmain, 50 here).Linux: WSL Ubuntu, g++ 15.2.0, cmake 4.2.3, Unix Makefiles,
-j4, from agit archiveof this code on the Linux filesystem.CMakeLists.txt:513and:521, because the machine has no X11 or audio development packages. In that local copy only, those twoFATAL_ERRORs became warnings. FFmpeg came from the project'sffmpeg-linux-x64.zipthroughFFMPEG_PREBUILT_DIR.PipelineJournal.cppstopped at the guard with(928 == 920).ShaderStagesstays at 164.shader_recompiler_agc_driver,agc_driver_pm4_tests,agc_driver_graphics_tests,agc_driver_depth_plane_buffer_memory_testsandagc_driver_gcn_depth_plane_buffer_memory_tests, and so all oflibSceAgcDriver. That includesGraphics/src/PipelineJournal.cppandcore/shader/recompiler/ShaderDiskCache.cpp, with their size guards active.agc_driver_depth_plane_buffer_memoryandagc_driver_gcn_depth_plane_buffer_memoryran on llvmpipe (LLVM 21.1.8); the other two print noSelected GPUline.Risk (CUSA03312): its board is sharp with a local stand-in that stores the same plane in the same tiling on the DB-flush
ACQUIRE_MEM. That stand-in ran onps4/limbo-gpuat93eeee0141(#6977's head then), with the Get-fix pull requests and local stand-ins forsceGnmDrawInitDefaultHardwareState200andsceGnmUpdate*Shader; that base predates #7154. This exact commit wasn't run in the title, which also needs #9432.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branch pr9895-local(this commit), againstmaind2250771ab. Six pull requests conflict with this PR's lines:DepthTarget::gcnnext togcnTileModeinState.hpp, and changes a neighbouring debt entry.sizeof(State)guard line.DepthFastClearHarness.hpp, at line 44 onmain.All of them compose, and whichever lands second resolves the conflict and recomputes the guard if
Statechanged. Another 64 pull requests conflict withmainthemselves, so the tool could not compare them; 41 of those share a file with this PR's code or tests, among them #6977 and #9432.Head
224af33ff1(2026-11-03): a docs-only commit on55cc111fe4that drops this PR's clause from the PS4 render-target debt entry, as XairRrR's review of55cc111fe4suggested; the entry is now identical tomain's and the PS4 depth-plane entry still states the tiling.tools/check_conventions.py --base origin/main(1e658521a0) passes. No code changed, so nothing was rebuilt or rerun.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:24:18Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The PR's own change is small and its new test catches what it claims, but the head no longer merges with
main, and on Linux/GCC the head itself does not compile: the newDepthTarget::gcnTileModefield tripsPipelineJournal.cpp'ssizeof(State)guard.What I ran
3e32049166cb89ae1de8e76b0ea92afba67e507d(merge base withmain:07da04f947)main:3a2b91981651569163768854a1fcdc7193b6667bResults
main3a2b919816Graphics/include/State.hppandGraphics/src/State.cppgit diff --checktools/check_conventions.py --base origin/mainPipelineJournal.cppstatic assertions (see below)PipelineJournal.cpp.oon the second parent4e8243ac48(#9431 merged withmain, without this PR)sizeof(State)848 andsizeof(ShaderStages)116agc_driver_gcn_depth_plane_buffer_memory(local size-guard edit, validation layer)depth_planetests (local size-guard edit, validation layer,-j4)agc_driver_depth_plane_partial_storeVUID-lines /was not found but was requested by env var VK_INSTANCE_LAYERSVK_LAYER_KHRONOS_validationinserted;Selected GPUis the RTX 4070 Ti SUPERBuild failure on the head
On
4e8243ac48(without this PR's commits) the same guard reports(848 == 840)and(116 == 112).Merge conflicts with main
3a2b919816State.hpp:main'sShaderStages::hullWaveSize/tessellationGeometryagainst #9431'slegacyVertex, andDrawKeyRegisters(50 entries onmain, 52 on the branch).State.cpp:decodeDepthPlane(the block that holds this PR'sgcnTileModeline),DecodeShaderStages(main's TessellationGeometry path) and theDecodeColorFormat/DecodeGcnColorBufferneighbourhood.Test run (local size-guard edit)
Negative control
Both on the head with the local size-guard edit:
DepthSurface.cpp,GuestTextureResource.cppandState.cpprestored from4e8243ac48(headers kept), the new test fails:PS4 depth tile mode 19 (512x256): after a buffer read of the depth plane, texel 0,0 holds 0.000000 at its tiled offset, expected 0.250000.!target.gcnTileMode.has_value()removed fromSizeUnits, it fails:PS4 depth tile mode 21 (256x128): after a buffer read of the depth plane, texel 0,64 holds 0.000000 at its tiled offset, expected 0.250000.Both match the description. Restoring the files makes the test pass again.
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:41-42already guardssizeof(State) == 840andsizeof(ShaderStages) == 112at the PR's own merge base07da04f947, but only under__linux__ && __x86_64__ && __GLIBCXX__. That is why the Windows runs in the description and in the comments built. This confirms babyhuey's report and adds two things. The head fails as pushed, not only after a merge onto a newermain. And this PR's ownstd::optional<TextureTileMode> gcnTileModeinDepthTarget(Graphics/include/State.hpp:97) adds 8 bytes toState(848 → 856) on top of #9431's growth.CanonicalPipelineStatecopies onlyformatandsamplesof the depth target, so the field doesn't need to reach the recipe codec.Statesize to its new value here.maininGraphics/include/State.hppandGraphics/src/State.cpp. Both conflicts come from #9431's side of the branch, but they includedecodeDepthPlane, which holds this PR'sgcnTileModeline. The checklist line "Based on currentmain" does not hold: the merge base is 3,853 commits behindmain. Fix: bring #9431 (ormerge/9431-main) up to currentmain, then this branch.Non-blocking
Surface::gcnTileModedirectly through the harness. Nothing covers theDB_Z_INFOdecode atGraphics/src/State.cpp:420, which mapsTILE_MODE_INDEX(bits 22:20) throughGcnTileModeand leaves it unset whenZ_FORMATis 0. A small decode test with a register set like the one in the description (DB_Z_INFO = 0xa0000003→kGcnDepth2D64, with a non-zero index such as 2 →kGcnDepth2D256) would cover it.tools/trace_digest.pynumbers.Not verified
main, because it conflicts, so the PR is tested only against its07da04f947base, plus the local size-guard edit.main-side validation-layer comparison for the AGC tests: the merged tree does not exist, and the PR head shares no build state with currentmain. The PR-side run had noVUID-lines.depth_planetests, not the wideragc_driver_*,video_out_flip_*oragc_gcn_decodeset from the description.DB_Z_INFO.TILE_MODE_INDEXis the authoritative depth tiling on Liverpool, rather thanDB_DEPTH_INFO's array mode and macro-tile fields as on other GFX7 parts, is taken from the shadPS4 approach the debt entry cites. I did not verify it.To get this to a good state
main, then this branch, resolvingState.hppandState.cpp.sizeof(State)guard inPipelineJournal.cppforgcnTileMode(andShaderStages, if #9431 has not), and build on Linux/GCC so the guard is checked.DB_Z_INFO.TILE_MODE_INDEX→DepthTarget::gcnTileMode.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T07:04:13Z.
Review: APPROVED
Re-checked — approved
Since my last review the branch has merged
mainagain, set thesizeof(State)guard to 936, added aDB_Z_INFOTILE_MODE_INDEXdecode test, and handled a PS4 depth plane bound again in another tile mode (sameSurfacenow compares the tile mode, the old surface is stored and retired, and the new surface is reloaded). The merged tree builds on Linux/GCC, the tests pass, and the negative controls fail where they should.What changed since my last review
ef34b9976eand the merge7253ae5a70: thesizeof(State)guard inPipelineJournal.cppis now 936. That is 920, plus 8 for this PR's field, plus 8 frommain.d8a0a2734b,5d1381c40eand7253ae5a70:mainmerged in. #9431 is onmain, so the diff now holds only this PR's ten files.4c37f8af0c: newGcnDepthTileModeTestsinagc_driver_graphics.0b365d9926:sameStorage/sameSurfacesplit. A retile loop callsretireStoringStaleon surfaces over the same storage in another tile mode, and a surface newly created after a retile goes throughLoadFromMemory.853389c92cand55f884b209: changes to the debt entry.c72cf633cd:TileModeSwitchcovers going back to a tiling, on both a new and a reused surface.What I ran
Head
7253ae5a70f5ebc23898c58950501db96ad1b6f7,maind1ae628bc2f62459cce1e9872ba5632c938c71f2, merged tree8a7f9d0e94fcec388272c42ea9488099a81de841. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19), in a clean worktree.The script's build and test run (build.json) and its validation-layer comparison with
mainwere also used.maingit diff --checkcheck_conventions.pysizeof(State)guard active)mainmain(script)VUID-agc_driver_gcn_depth_plane_buffer_memoryagc_driver_graphicsNegative control
DepthSurface.cppandState.cppfrommain(headers kept)agc_driver_gcn_depth_plane_buffer_memoryfails:PS4 depth tile mode 19 (512x256): after a buffer read of the depth plane, texel 0,0 holds 0.000000 at its tiled offset, expected 0.250000.agc_driver_graphicsfails:PS4 DB_Z_INFO 0xa0000003 did not decode as Depth2D64sameSurfacePS4 depth tile mode 19 then 21: the second tiling, after a buffer read: texel 128,0 holds 0.750000 at its tiled offset, expected 0.250000, as the author reportedLoadFromMemorybranch disabled (DepthSurface.cpp:2573)After restoring,
git status --porcelainwas empty and both tests passed again.Previous findings
sizeof(State)guard: Resolved.PipelineJournal.cpp:44now readssizeof(State) == 936, and the merged tree compiled with GCC/libstdc++ on Linux x86_64, where the guard is active.CanonicalPipelineStatestill does not need the field.main: Resolved. The head merges intod1ae628bc2without conflicts, and the diff holds only this PR's files.GcnDepthTileModeTests(tests/Graphics.cpp:748-795) covers index 0, 2 and 7, the field above the index, a surface with no depth plane, and PS5. RevertingState.cppmakes it fail with its own message.New findings
Blocking
None.
Non-blocking
LoadFromMemorybranch is not covered by the test. With line 2573 ofGraphics/src/DepthSurface.cppdisabled, so a new surface after a retile takesSyncFromMemory,agc_driver_gcn_depth_plane_buffer_memorystill passes on Linux/lavapipe. The likely reason: a PS4 plane is one unit, and a freshly created surface hasunitGeneration0. On a write-watched Linux host,WrittenUnitstakes theunitGeneration.size() == 1ubranch (DepthSurface.cpp:1108-1110), andWrittenSince(..., 0)reports the whole plane, soSyncFromMemoryreloads it anyway. The author reports that removingLoadFromMemoryfails on Windows. I accept that as author-reported, so the branch is not dead, but the regression only discriminates on some hosts. This is a coverage gap, not a bug.Not verified
LoadFromMemorycontrol fails.DB_Z_INFO.TILE_MODE_INDEX, rather thanDB_DEPTH_INFO, is the authoritative depth tiling on Liverpool. The debt entry records this as unverified.agc_driver_graphicstook 34.5 s here, over the 30 s budget. This PR adds only a few decodes to it, and the NVIDIA bot reported the test at about 30–33 s onmain-based runs, so I don't attribute the time to this PR. I did not time it onmainon this machine.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T18:37:42Z.
Review: APPROVED
Re-checked — approved
The only new commit is the merge
55cc111fe4, which brings inmain1e658521a0. It keeps both this PR'sDepthTarget::gcnTileModeandmain'sDepthTarget::gcn(#9672). The merged tree builds, the focused tests pass, and the negative control still fails.What changed since my last review
55cc111fe4mergesmain1e658521a0.State.hpp:DepthTargetnow has bothstd::optional<TextureTileMode> gcnTileModeandbool gcn.sizeof(State)guard stays at 936. It compiles with GCC 14 and libstdc++ on Linux x86_64, where the guard is active.main'sgcnflag interacts with this PR's code. It is used inDepthSurface.cpponly by the cropped level-0 view path at line 3264. That path requiresresource.gcnPitchto be 0 or equal tobase.extent.width, the same pitchmirrorResourcenow gives a PS4 plane.sameStorageandsameSurfacedo not comparegcn, and they don't need to:gcnTileModeis set only whengcnis true andzFormat != 0.What I ran
Head
55cc111fe40dd0c28f0f35a73dc4250a065bc525,main1e658521a0a599872612bb91949311e2956b5283, merged tree6f5b068e70faff96afa457984dd88bdb521193f5. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19), in a clean worktree.maingit diff --checkcheck_conventions.pydebt-lengthwarning (see below)mainmain(script)VUID-agc_driver_gcn_depth_plane_buffer_memoryagc_driver_depth_plane_buffer_memoryagc_driver_gcn_padded_depth_sampling(main'sgcnuser)agc_driver_graphicsNegative control. I restored
DepthSurface.cppandState.cppfrommain.agc_driver_gcn_depth_plane_buffer_memorythen fails:PS4 depth tile mode 19 (512x256): after a buffer read of the depth plane, texel 0,0 holds 0.000000 at its tiled offset, expected 0.250000. With the merged files back, it passes andgit status --porcelainis empty.Previous findings
LoadFromMemorybranch is not covered on this host: Still open. The code and test are unchanged since7253ae5a70, so the observation from my last review still holds. It is a coverage gap, not a bug. The author reports that removing the branch fails the test on Windows, and I accept that as author-reported.New findings
Blocking
None.
Non-blocking
check_conventions.pywarns ondocs/dev/debt/libSceAgcDriver.md:119(1092 characters). Onmainthat entry is 999 characters, and the clause this PR adds ("and a 32-bit plane reaches guest memory in that tiling (depth planes in guest memory, below)") pushes it over. It is a warning, not an error. The PR has its own PS4 depth-plane entry, so the clause could be dropped or shortened to a cross-reference.Not verified
LoadFromMemorycontrol is author-reported only.DB_Z_INFO.TILE_MODE_INDEX, rather thanDB_DEPTH_INFO, is the authoritative depth tiling on Liverpool. The debt entry records this.agc_driver_graphicstook 36.4 s here, with four tests running in parallel, which is over the 30 s budget. This PR adds only a few decodes to it, and it was already about 30–34 s in earliermain-based runs. I did not time it onmainthis round.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:20:10Z.
Review: CHANGES_REQUESTED
Re-checked — changes still requested
The new commit
224af33ff1drops the clause from the PS4 render-target debt entry, and that clears my previous debt-length finding. Butmainhas moved since1e658521a0: #11557 also grewStateby 8 bytes and set the Linux guard to 936. That is the same line and value as this PR's guard, so git merges it without a conflict, and the merged tree fails to compile.What changed since my last review
224af33ff1(docs only). The PS4 render-target entry indocs/dev/debt/libSceAgcDriver.mdis now identical tomain's. Commits 1–7 are unchanged (range-diff).mainmoved from1e658521a0to81b1a632dc. Among its changes, merge0e7df59efb(#11557) addsstaged,stagedMaskandstagedFormattoColorTargetinState.hpp. It also changesstatic_assert(sizeof(State) == 928, …)to== 936inPipelineJournal.cpp.What I ran
Head
224af33ff19cdce2640c990bccbd9221a1ae3e02,main81b1a632dc5ba74afc4f8ab8f67b29501e4601b7, merged treebca68f0dcab61d1e1c739cb7cbad4ff0778124a5. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).maingit diff --checkcheck_conventions.pydebt-lengthwarning is gone)PipelineJournal.cpp:44static assertion,(944 == 936)main(script)agc_driver_gcn_depth_plane_buffer_memoryBuild error (script)
I did not rerun the negative control. The PR's code and tests are unchanged since my last review, where restoring
DepthSurface.cppandState.cppfrommainmadeagc_driver_gcn_depth_plane_buffer_memoryfail at tile mode 19, texel 0,0. With the merged tree as it stands, nothing builds that could be controlled.Previous findings
224af33ff1restoresmain's text, andcheck_conventions.pynow passes with no warning.LoadFromMemorybranch is not reached on this host. Still open. The code and test are unchanged. It is a coverage gap, and the author's Windows control is accepted as author-reported.New findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44.main81b1a632dc(#11557) and this branch each moved the guard from 928 to 936 for different fields. Git keeps the shared line silently. With bothColorTarget's staged fields andDepthTarget::gcnTileMode,sizeof(State)is 944. The same thing happened in the7253ae5a70merge.mainand set the guard to 944.libSceAgcDriverandagc_driver_gcn_depth_plane_buffer_memory_testsbuild here, and the test passes.gcnTileModestill does not reachCanonicalPipelineStateor the recipe codec, so no codec change is needed for this PR's field.Non-blocking
None.
Not verified
agc_driver_gcn_depth_plane_buffer_memory, with the guard bumped locally.agc_driver_graphicsand the other depth tests were not rerun this round.DB_Z_INFO.TILE_MODE_INDEX, rather thanDB_DEPTH_INFO, is the authoritative depth tiling on Liverpool. The debt entry records this.To get this to a good state
mainand change thesizeof(State)guard inPipelineJournal.cppto 944 (this PR's 8 bytes on top ofmain's 936).libSceAgcDriveron Linux x86_64 with GCC/libstdc++, where the guard is active. Rerunagc_driver_gcn_depth_plane_buffer_memoryandagc_driver_graphics.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T22:25:36Z.
Review: APPROVED
Re-checked — approved
The new merge commit
21e42481a3mergesmain04a9eb4fa2and sets thesizeof(State)guard to 944, which fixes the build failure I reported last time. The merged tree builds, and the PR's tests pass.What changed since my last review
21e42481a3, a merge ofmain04a9eb4fa2into224af33ff1. Commits 1–8 are unchanged (range-diff).mainstill covers the same ten files. The only change in that diff iscore/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44, which now readsstatic_assert(sizeof(State) == 944, …).What I ran
Head
21e42481a3ff9e3e2f35b66b34fb85dd234c8bad,main04a9eb4fa2877eb6e40bf2c83adf972e40d89b24, merged treedea4eb608093393d2a655098659772f2eb368b39. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).maingit diff --checkcheck_conventions.pylibsmain. 1 timeout (see below).agc_driver_gcn_depth_plane_buffer_memoryagc_driver_graphics(includesGcnDepthTileModeTests)agc_driver_depth_plane_buffer_memoryagc_driver_alpha_to_coverage_sample_mask_export(script timeout)agc_driver_image_gather_volumemain(script)VUID-lines appear only inagc_driver_image_gather_volume, a test the baseline did not run (see below).About the timeout and the new VUIDs
agc_driver_alpha_to_coverage_sample_mask_exporttimed out at 30.2 s in the script's run. When I reran it alongside four other tests, it passed in 23.5 s. The PR does not touch alpha-to-coverage or sample-mask code. I put this down to load on a shared machine, not to the PR.VUID-VkSamplerCreateInfo-addressModeU-01079andaddressMode{U,V,W}-parameterare reported only foragc_driver_image_gather_volume, marked "test not run on main".mainchanged that test after the baseline1e658521a0(27d9dc2e4e,5af9948a3e,e92ec413c9). This PR touches no sampler code, so I do not count these against it.Previous findings
PipelineJournal.cpp:44,944 == 936). Resolved. The guard is now 944, the script's build of the merged tree passed, and the PR's tests ran and pass.gcnTileModestill does not reachCanonicalPipelineStateor the recipe codec, so no codec change is needed.LoadFromMemorybranch is not reached on this host. Still open. The code and test are unchanged since then. It is a coverage gap; the author's Windows run of that branch is accepted as author-reported.New findings
Blocking
None.
Non-blocking
None.
Not verified
DepthSurface.cppandState.cppfrommainmadeagc_driver_gcn_depth_plane_buffer_memoryfail at tile mode 19, texel 0,0. This round's merge changed only the guard value.agc_driver_graphicsruntime. It took 34.9 s here, run in parallel with four other tests. It was already near or over 30 s onmainin the contributors' CI runs, and this PR adds only a small decode test to it. I did not time it onmainon this machine.DB_Z_INFO.TILE_MODE_INDEX, rather thanDB_DEPTH_INFO, is the authoritative depth tiling on Liverpool is unverified. The debt entry records this.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:25:45Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected code adds PS4 depth-plane mirroring and retile handling; this review is incomplete because I did not read every changed file or run checks on this head.
What I ran
Head:
d70e6e1bc1caaee46f386a47afb104518e0be9f3. I usedrepo_read.pyreader tools to inspect the prepared description, commits, manifest and diff, plus targeted source ranges. I ran no build or tests; the reported test results are from the author.Results
tests/Graphics.cppwas excluded from the review folderFindings
Blocking
None in the code inspected.
Non-blocking
The author reports GPU and Linux test results on earlier heads, but the exact reviewed head was not built or tested during this review.
Not verified
I read the prepared
description.md,commits.md,manifest.json, anddiff.patch. I inspected targeted ranges inGuestTextureResource.cpp,State.cpp,State.hpp,DepthSurface.cpp, andPipelineJournal.cpp; the diff includes changes inGuestTextureResource.hpp,DepthFastClearHarness.hpp,GcnDepthPlaneBufferMemory.cpp, andlibSceAgcDriver.md. I did not read the full changed files, andtests/Graphics.cppwas excluded as too large for the review folder. Console behavior and the author-reported tests were not independently verified.To get this to a good state
Nothing is required. Optional: run the relevant checks on this exact head and complete review of the excluded test file before relying on a formal merge decision.
Sources
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.