feat(agc): retain and refresh sampled depth array storage #1368

Closed
TibixDev wants to merge 8 commits from upstream-pr/1368 into main
TibixDev commented 2026-10-08 00:31:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T00:31:44Z.


What

Sample resident depth/stencil surfaces through 2D-array descriptors, including views starting at a later base slice. Assemble matching resident slices on the GPU and detile guest-backed slices. Uncommitted guest pages read as zero, matching the existing partially resident texture path.

Refresh array storage after recorded depth/stencil writes and HTILE fast clears. Component mappings share backing storage; depth and stencil changes are tracked separately. Preserve current main's reused-memory checks, pending-clear handling and multisampled depth attachments; sampling multisampled depth remains rejected.

Initially rebased on main d146ec1b6, using and reviewing blawesom's proposed rebase. Fixed the additional multisample conflict and malformed lines in that rebase.

Refreshed onto main e013f8c9c after newer upstream changes. Preserve DepthResummarizeDrawsNothing and register main's in-place draw-input tests alongside the depth tests, including Windows PATH setup.

Evidence and merge order

XairRrR's Uncharted report identifies PPSA05684 stopping when sampling a 2048×2048 D16 surface through a four-layer array T#, and a 2560×1440 stencil plane through a one-layer array T#. The new tests decode and sample those descriptor shapes.

fisherjoey's Demon's Souls report identifies an 80-layer D32 atlas with uncommitted layer 17. A reduced-size 80-layer regression checks zero reads, subsequent commitment and decommitment, and preservation of the resident slice.

Depends on: none. Proposed merge order: this PR first, then reconcile #425 and its #1186/#2490/#2491 follow-ups. Those branches implement an alternative depth-plane-copy path; this PR already covers later base slices, guest-layer refresh and unchanged resident-slice reuse for its supported 2D-array path. Their cube, integer-plane and storage-image behavior is outside this PR. The later branch needs to retain one implementation of the overlapping array behavior.

Tested

Refreshed head on e013f8c9c:

Fedora 44 Release: nine targeted CTests pass on RX 6600 RADV (depth arrays/shapes/failure/clear, graphics, PM4, multisample guest access, in-place draw inputs and read-only resummarize), and six depth/graphics/resummarize CTests pass on lavapipe. Core and synchronization validation logs contain no validation errors. Conventions and diff checks pass.

Earlier validation (d146ec1b6 base)

Fedora 44, GCC 16.2.1, Release:

  • Build: agc_driver_recorder_tests, agc_driver_graphics_tests, agc_driver_mesh_tests.
  • RX 6600 RADV and lavapipe: agc_depth_array, agc_depth_array_shapes, agc_depth_array_failure, agc_depth_clear pass with Vulkan core and synchronization validation; no validation errors.
  • Graphics tests, including depth-surface reuse, pass on both. Mesh and multisample guest-access tests pass on RADV; mesh skips on lavapipe because its required features are unavailable.
  • Full default recorder suite passes on lavapipe.
  • Mutation check: removing fast-clear invalidation fails the HTILE refresh regression; restoring strict guest reads fails the sparse-layer regression. Both pass with the fixes restored.
  • Contribution checks and git diff --check pass.

The four depth tests are now registered in CTest with 30-second timeouts. No fresh title run or Windows runtime run is claimed. Console layout equivalence and remaining limitations are recorded in TechnicalDebt.

Checklist

  • Based on current main at the revision above; overlapping work and merge order stated.
  • One topic.
  • No new code comments.
  • Unsupported paths still throw; limitations are documented.
  • No notes, logs, or images added to the repository.
  • No new third-party code.
  • General behavior.
  • Depends on: none; proposed merge order described above.
  • AI-assisted: yes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4780155754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T00:31:44Z. --- ### What Sample resident depth/stencil surfaces through 2D-array descriptors, including views starting at a later base slice. Assemble matching resident slices on the GPU and detile guest-backed slices. Uncommitted guest pages read as zero, matching the existing partially resident texture path. Refresh array storage after recorded depth/stencil writes and HTILE fast clears. Component mappings share backing storage; depth and stencil changes are tracked separately. Preserve current main's reused-memory checks, pending-clear handling and multisampled depth attachments; sampling multisampled depth remains rejected. Initially rebased on main `d146ec1b6`, using and reviewing [blawesom's proposed rebase](https://github.com/blawesom/AnyPS5/tree/rebase/pr-1368). Fixed the additional multisample conflict and malformed lines in that rebase. Refreshed onto main `e013f8c9c` after newer upstream changes. Preserve `DepthResummarizeDrawsNothing` and register main's in-place draw-input tests alongside the depth tests, including Windows PATH setup. ### Evidence and merge order [XairRrR's Uncharted report](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6080348877) identifies PPSA05684 stopping when sampling a 2048×2048 D16 surface through a four-layer array T#, and a 2560×1440 stencil plane through a one-layer array T#. The new tests decode and sample those descriptor shapes. [fisherjoey's Demon's Souls report](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6067838313) identifies an 80-layer D32 atlas with uncommitted layer 17. A reduced-size 80-layer regression checks zero reads, subsequent commitment and decommitment, and preservation of the resident slice. Depends on: none. Proposed merge order: this PR first, then reconcile #425 and its #1186/#2490/#2491 follow-ups. Those branches implement an alternative depth-plane-copy path; this PR already covers later base slices, guest-layer refresh and unchanged resident-slice reuse for its supported 2D-array path. Their cube, integer-plane and storage-image behavior is outside this PR. The later branch needs to retain one implementation of the overlapping array behavior. ### Tested Refreshed head on `e013f8c9c`: Fedora 44 Release: nine targeted CTests pass on RX 6600 RADV (depth arrays/shapes/failure/clear, graphics, PM4, multisample guest access, in-place draw inputs and read-only resummarize), and six depth/graphics/resummarize CTests pass on lavapipe. Core and synchronization validation logs contain no validation errors. Conventions and diff checks pass. ### Earlier validation (`d146ec1b6` base) Fedora 44, GCC 16.2.1, Release: - Build: `agc_driver_recorder_tests`, `agc_driver_graphics_tests`, `agc_driver_mesh_tests`. - RX 6600 RADV and lavapipe: `agc_depth_array`, `agc_depth_array_shapes`, `agc_depth_array_failure`, `agc_depth_clear` pass with Vulkan core and synchronization validation; no validation errors. - Graphics tests, including depth-surface reuse, pass on both. Mesh and multisample guest-access tests pass on RADV; mesh skips on lavapipe because its required features are unavailable. - Full default recorder suite passes on lavapipe. - Mutation check: removing fast-clear invalidation fails the HTILE refresh regression; restoring strict guest reads fails the sparse-layer regression. Both pass with the fixes restored. - Contribution checks and `git diff --check` pass. The four depth tests are now registered in CTest with 30-second timeouts. No fresh title run or Windows runtime run is claimed. Console layout equivalence and remaining limitations are recorded in TechnicalDebt. ### Checklist - [x] Based on current main at the revision above; overlapping work and merge order stated. - [x] One topic. - [x] No new code comments. - [x] Unsupported paths still throw; limitations are documented. - [x] No notes, logs, or images added to the repository. - [x] No new third-party code. - [x] General behavior. - [x] Depends on: none; proposed merge order described above. - [x] AI-assisted: yes.
oneandonlydean commented 2026-10-08 06:37:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T06:37:31Z.


Which title samples a depth array on main, and where does it stop? The description says no game was run, and this is 810 lines in the draw path; with the title ID and the log line it can be reviewed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6054015053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6054015053). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T06:37:31Z. --- Which title samples a depth array on main, and where does it stop? The description says no game was run, and this is 810 lines in the draw path; with the title ID and the log line it can be reviewed.
TibixDev commented 2026-10-08 07:19:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:19:49Z.


Rebased on e705d430. Preserved the latest CMASK, mesh, inert-pixel-stage and import fixes. Grouped depth-array limitations with the graphics notes to avoid section-header conflicts. The title-evidence request remains open.

Fedora 44 Release: agc_driver_graphics_tests, agc_driver_recorder_tests build; the targeted tests and contribution checks pass. Windows CI is pending.
RADV and lavapipe: --depth-array-only, --depth-clear-only, --depth-array-failure-only pass with core and synchronization validation; no validation errors.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6054763180 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6054763180). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T07:19:49Z. --- Rebased on `e705d430`. Preserved the latest CMASK, mesh, inert-pixel-stage and import fixes. Grouped depth-array limitations with the graphics notes to avoid section-header conflicts. The title-evidence request remains open. Fedora 44 Release: `agc_driver_graphics_tests`, `agc_driver_recorder_tests` build; the targeted tests and contribution checks pass. Windows CI is pending. RADV and lavapipe: `--depth-array-only`, `--depth-clear-only`, `--depth-array-failure-only` pass with core and synchronization validation; no validation errors.
fisherjoey commented 2026-10-08 17:42:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T17:42:45Z.


Heads-up for merge order: #1430 fast-proves depth lookups and skips DepthSurfaceTexture. With this PR, array lookups refresh slices there, so #1430 now limits its fast path to 2D depth views and leaves arrays on the full walk.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6065667509 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6065667509). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T17:42:45Z. --- Heads-up for merge order: #1430 fast-proves depth lookups and skips `DepthSurfaceTexture`. With this PR, array lookups refresh slices there, so #1430 now limits its fast path to 2D depth views and leaves arrays on the full walk.
fisherjoey commented 2026-10-08 19:50:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T19:50:55Z.


One more case from Demon's Souls for the guest-layer path, in case it's useful.

The title samples an 80-layer D32 shadow atlas at 0x2a4700000 as one array view, and not every layer's memory is committed: layer 17 (0x2a8b00000) is unmapped. Sampling the whole array then throws guest memory is not readable while the slices are read from guest memory (run295). On a local branch we read uncommitted pages as zeros, the way partially resident textures read, and the level gets past it. With this PR such arrays go through CopySlices, so the same layers would need that rule (or a skip) there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6067838313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6067838313). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T19:50:55Z. --- One more case from Demon's Souls for the guest-layer path, in case it's useful. The title samples an 80-layer D32 shadow atlas at `0x2a4700000` as one array view, and not every layer's memory is committed: layer 17 (`0x2a8b00000`) is unmapped. Sampling the whole array then throws `guest memory is not readable` while the slices are read from guest memory (run295). On a local branch we read uncommitted pages as zeros, the way partially resident textures read, and the level gets past it. With this PR such arrays go through `CopySlices`, so the same layers would need that rule (or a skip) there.
XairRrR commented 2026-10-09 11:55:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:55:22Z.


Uncharted: Legacy of Thieves Collection (PPSA05684) needs this: a compute shader samples a 2048x2048 D16 depth surface as a 4-layer 2D-array T# (probably shadow cascades) and stops on main with:

compute shader 0x140015a900: AGC graphics: sampling the depth plane of depth surface 0x1492ab0000 (2048x2048, vk format 124) as a 2048x2048 texture of guest format 7 (vk 70), tile mode 4, dimension 2, levels 0 ...

Another shader reads a stencil plane through a one-layer 2D-array T#:

compute shader 0x14001b4300: AGC graphics: sampling the stencil plane of depth surface 0x1468930000 (2560x1440, vk format 130) as a 2560x1440 texture of guest format 5 (vk 13), tile mode 4, dimension 2, levels 0-0, slices 0-0 is not implemented

I worked around both locally (consecutive slices copied into an array image, one-layer arrays viewed directly) to reach the title's main menu, but I'm not opening a competing PR since this one covers it. I have not run this branch itself with the title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080348877 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6080348877). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-09T11:55:22Z. --- Uncharted: Legacy of Thieves Collection (PPSA05684) needs this: a compute shader samples a 2048x2048 D16 depth surface as a 4-layer 2D-array T# (probably shadow cascades) and stops on `main` with: ``` compute shader 0x140015a900: AGC graphics: sampling the depth plane of depth surface 0x1492ab0000 (2048x2048, vk format 124) as a 2048x2048 texture of guest format 7 (vk 70), tile mode 4, dimension 2, levels 0 ... ``` Another shader reads a stencil plane through a one-layer 2D-array T#: ``` compute shader 0x14001b4300: AGC graphics: sampling the stencil plane of depth surface 0x1468930000 (2560x1440, vk format 130) as a 2560x1440 texture of guest format 5 (vk 13), tile mode 4, dimension 2, levels 0-0, slices 0-0 is not implemented ``` I worked around both locally (consecutive slices copied into an array image, one-layer arrays viewed directly) to reach the title's main menu, but I'm not opening a competing PR since this one covers it. I have not run this branch itself with the title.
oneandonlydean commented 2026-10-09 20:14:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:14:33Z.


Please rebase: it conflicts with main in State.hpp, tests/Recorder.cpp, tests/shaders/SampleArray.comp, CMakeLists.txt and TechnicalDebt.md. PPSA05684's stop above (XairRrR) answers the title question.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088507918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6088507918). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T20:14:33Z. --- Please rebase: it conflicts with main in `State.hpp`, `tests/Recorder.cpp`, `tests/shaders/SampleArray.comp`, `CMakeLists.txt` and `TechnicalDebt.md`. PPSA05684's stop above (XairRrR) answers the title question.
adriadam10 commented 2026-10-11 09:07:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:07:44Z.

Review: CHANGES_REQUESTED


Thanks for the rebase on 10-08. main has moved (2350+ commits) and the PR now conflicts in CMakeLists.txt, State.hpp, Texture.hpp, DepthSurface.cpp, Draw.cpp, tests/Recorder.cpp, tests/shaders/SampleArray.comp and TechnicalDebt.md. The DepthSurface.cpp/Draw.cpp ones are not mechanical, so this needs a rebase from you, as @oneandonlydean already asked:

  • Rebase on current main and rerun the PR's own tests (agc_driver_recorder_tests, the array, clear and failure-cleanup cases) after it; the SampleArray.comp and test-list changes in particular.
  • Reconcile with #2490 and #2491 (also rework the guest-layer copy of a depth plane) and with #1186 (sampling from a later base slice). Say in "Depends on" which one lands first, or drop what overlaps.
  • Demon's Souls case from @fisherjoey above: an 80-layer D32 array where some layers are unmapped (0x2a8b00000). Guest-backed layers go through CopySlices here, so GuestMemory::Read will throw guest memory is not readable there. Either read uncommitted pages as zeros, as partially resident textures do, or add a test showing the intended behaviour.
  • The title question is answered by @XairRrR (PPSA05684); cite its stop message in the description, and add a test that reproduces the 4-layer D16 array T# (2048x2048) and the one-layer stencil array.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482693812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#pullrequestreview-5482693812). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T09:07:44Z. **Review:** CHANGES_REQUESTED --- Thanks for the rebase on 10-08. `main` has moved (2350+ commits) and the PR now conflicts in `CMakeLists.txt`, `State.hpp`, `Texture.hpp`, `DepthSurface.cpp`, `Draw.cpp`, `tests/Recorder.cpp`, `tests/shaders/SampleArray.comp` and `TechnicalDebt.md`. The `DepthSurface.cpp`/`Draw.cpp` ones are not mechanical, so this needs a rebase from you, as @oneandonlydean already asked: - Rebase on current `main` and rerun the PR's own tests (`agc_driver_recorder_tests`, the array, clear and failure-cleanup cases) after it; the `SampleArray.comp` and test-list changes in particular. - Reconcile with #2490 and #2491 (also rework the guest-layer copy of a depth plane) and with #1186 (sampling from a later base slice). Say in "Depends on" which one lands first, or drop what overlaps. - Demon's Souls case from @fisherjoey above: an 80-layer D32 array where some layers are unmapped (`0x2a8b00000`). Guest-backed layers go through `CopySlices` here, so `GuestMemory::Read` will throw `guest memory is not readable` there. Either read uncommitted pages as zeros, as partially resident textures do, or add a test showing the intended behaviour. - The title question is answered by @XairRrR (PPSA05684); cite its stop message in the description, and add a test that reproduces the 4-layer D16 array T# (2048x2048) and the one-layer stencil array.
blawesom commented 2026-10-11 09:09:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T09:09:20Z.


Hi! This PR currently conflicts with main, so I rebased its 7 commits onto the latest main. This was the deepest of the three TibixDev memory PRs — main rewrote DepthSurface (HTILE fast clears, pending clears, write notes) while this PR rebuilt it for depth/stencil arrays — so the rebased branch merges both, with a few semantic decisions the author should review:

  • The PR's array machinery (find/stride/slices, ValidateSampled, NoteDepthSurfaceWrite, shared backing) is kept, alongside main's DepthSurfaceHolds, HTILE helpers (HtileFillClears/HtileMetadataBytes/HtileFillCovers/NoteDepthMetadataFill), pendingClear and ApplyFastClear.
  • DepthSurfaceTexture: main's newer reused memory model returns nullptr for a view of another extent or format over a surface's memory; the PR's ValidateSampled throws for those. The merge keeps main's lenient extent/format pre-checks (returning nullptr) before the PR's strict validation, so both this PR's array tests and main's DepthSurfaceReuse tests pass.
  • Main's fast-clear-on-sample (ApplyFastClear) is applied to the base and the resident slices before Sampled.
  • DepthSurfaceView: main's clear-value/pendingClear updates run together with the PR's registration.
  • Test adaptations for main's newer shader model: the guest sampled-image binding now uses RuntimeAbi::FirstImageBinding, context.nullDescriptors = true, and the DepthSurfaceReuse stub sets maxImageArrayLayers.

It builds, and agc_driver_recorder_tests (including this PR's --depth-array-only and --depth-clear-only modes and the full default suite), agc_driver_graphics_tests and agc_driver_mesh_tests all pass locally.

The rebased branch is available to pull:

git fetch https://github.com/blawesom/AnyPS5 rebase/pr-1368
git reset --hard FETCH_HEAD

Feel free to ignore this if you'd rather rebase yourself.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107442451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6107442451). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T09:09:20Z. --- Hi! This PR currently conflicts with `main`, so I rebased its 7 commits onto the latest `main`. This was the deepest of the three TibixDev memory PRs — main rewrote `DepthSurface` (HTILE fast clears, pending clears, write notes) while this PR rebuilt it for depth/stencil arrays — so the rebased branch merges both, with a few semantic decisions the author should review: - The PR's array machinery (find/stride/slices, `ValidateSampled`, `NoteDepthSurfaceWrite`, shared backing) is kept, alongside main's `DepthSurfaceHolds`, HTILE helpers (`HtileFillClears`/`HtileMetadataBytes`/`HtileFillCovers`/`NoteDepthMetadataFill`), `pendingClear` and `ApplyFastClear`. - `DepthSurfaceTexture`: main's newer *reused memory* model returns `nullptr` for a view of another extent or format over a surface's memory; the PR's `ValidateSampled` throws for those. The merge keeps main's lenient extent/format pre-checks (returning `nullptr`) before the PR's strict validation, so both this PR's array tests and main's `DepthSurfaceReuse` tests pass. - Main's fast-clear-on-sample (`ApplyFastClear`) is applied to the base and the resident slices before `Sampled`. - `DepthSurfaceView`: main's clear-value/pendingClear updates run together with the PR's registration. - Test adaptations for main's newer shader model: the guest sampled-image binding now uses `RuntimeAbi::FirstImageBinding`, `context.nullDescriptors = true`, and the `DepthSurfaceReuse` stub sets `maxImageArrayLayers`. It builds, and `agc_driver_recorder_tests` (including this PR's `--depth-array-only` and `--depth-clear-only` modes and the full default suite), `agc_driver_graphics_tests` and `agc_driver_mesh_tests` all pass locally. The rebased branch is available to pull: ``` git fetch https://github.com/blawesom/AnyPS5 rebase/pr-1368 git reset --hard FETCH_HEAD ``` Feel free to ignore this if you'd rather rebase yourself.
TibixDev commented 2026-10-12 03:35:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T03:35:38Z.


@adriadam10 @oneandonlydean Updated to db7951d87, rebased on main d146ec1b6.

  • Guest-backed array slices now read uncommitted pages as zero. The 80-layer regression covers the reported missing layer 17, later commitment/decommitment, and preservation of resident slices.
  • Added descriptor-shape regressions for the reported Uncharted 2048×2048 four-layer D16 array and 2560×1440 one-layer stencil array.
  • Fixed HTILE fast-clear invalidation of cached array copies while preserving main's reused-memory checks, pending clears and multisampled attachments. Thanks to blawesom for the proposed rebase, which I reviewed and adapted.
  • The description now cites the title reports and proposes this PR first, followed by reconciliation of the overlapping #425/#1186/#2490/#2491 paths. Depends on: none.

Fedora 44 Release: all four depth CTests pass on RX 6600 RADV and lavapipe with core and synchronization validation, with no validation errors. Graphics, mesh and multisample checks pass on RADV; the full recorder suite passes on lavapipe. Removing either the sparse-read or fast-clear fix makes its regression fail. Contribution checks pass.

Ready for another review. Fresh title and Windows runtime runs are still outstanding; the title-shaped regressions are not a claim that I reran those games.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117274954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6117274954). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-12T03:35:38Z. --- @adriadam10 @oneandonlydean Updated to `db7951d87`, rebased on main `d146ec1b6`. - Guest-backed array slices now read uncommitted pages as zero. The 80-layer regression covers the reported missing layer 17, later commitment/decommitment, and preservation of resident slices. - Added descriptor-shape regressions for the reported Uncharted 2048×2048 four-layer D16 array and 2560×1440 one-layer stencil array. - Fixed HTILE fast-clear invalidation of cached array copies while preserving main's reused-memory checks, pending clears and multisampled attachments. Thanks to blawesom for the proposed rebase, which I reviewed and adapted. - The description now cites the title reports and proposes this PR first, followed by reconciliation of the overlapping #425/#1186/#2490/#2491 paths. Depends on: none. Fedora 44 Release: all four depth CTests pass on RX 6600 RADV and lavapipe with core and synchronization validation, with no validation errors. Graphics, mesh and multisample checks pass on RADV; the full recorder suite passes on lavapipe. Removing either the sparse-read or fast-clear fix makes its regression fail. Contribution checks pass. Ready for another review. Fresh title and Windows runtime runs are still outstanding; the title-shaped regressions are not a claim that I reran those games.
TibixDev commented 2026-10-12 04:58:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:58:16Z.


Main moved again during this review pass, so I refreshed the branch onto e013f8c9c and pushed 42d1193c4. The resolution keeps main's new DepthResummarizeDrawsNothing declaration and in-place draw-input CTest alongside the array tests, including the combined Windows PATH setup. The depth implementation is unchanged from the reviewed fixes.

Fresh Release validation: all nine targeted RADV tests pass (depth arrays/shapes/failure/clear, graphics, PM4, multisample guest access, in-place draw inputs and read-only resummarize); all six selected lavapipe depth/graphics/resummarize tests pass. Both runs use core/synchronization validation with no validation errors. Conventions and diff checks pass. The body now separates these refreshed-head results from the earlier broader checks. Full platform CI still needs collaborator dispatch. AI-assisted update.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118032599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6118032599). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-12T04:58:16Z. --- Main moved again during this review pass, so I refreshed the branch onto `e013f8c9c` and pushed `42d1193c4`. The resolution keeps main's new `DepthResummarizeDrawsNothing` declaration and in-place draw-input CTest alongside the array tests, including the combined Windows PATH setup. The depth implementation is unchanged from the reviewed fixes. Fresh Release validation: all nine targeted RADV tests pass (depth arrays/shapes/failure/clear, graphics, PM4, multisample guest access, in-place draw inputs and read-only resummarize); all six selected lavapipe depth/graphics/resummarize tests pass. Both runs use core/synchronization validation with no validation errors. Conventions and diff checks pass. The body now separates these refreshed-head results from the earlier broader checks. Full platform CI still needs collaborator dispatch. AI-assisted update.
oneandonlydean commented 2026-10-12 08:23:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:23:40Z.


Conflicts with main again in Graphics/include/DepthSurface.hpp; please rebase. Two things in the same push:

  • RunDepthClearPass, DepthClearPass and DepthSurface::Clear(const DepthClearPass&) are only called from tests/Recorder.cpp. Drop them from this PR and drive the clears in the tests through a path the driver already takes; they belong with #1395.
  • DepthSurfaceTexture gained a two-line comment ("A view of another extent or format over a surface's memory is reused memory ..."). No code comments, please.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120512292 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6120512292). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T08:23:40Z. --- Conflicts with main again in `Graphics/include/DepthSurface.hpp`; please rebase. Two things in the same push: - `RunDepthClearPass`, `DepthClearPass` and `DepthSurface::Clear(const DepthClearPass&)` are only called from `tests/Recorder.cpp`. Drop them from this PR and drive the clears in the tests through a path the driver already takes; they belong with #1395. - `DepthSurfaceTexture` gained a two-line comment ("A view of another extent or format over a surface's memory is reused memory ..."). No code comments, please.
adriadam10 commented 2026-10-13 09:15:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T09:15:18Z.

Review: CHANGES_REQUESTED


Thanks for the repeated rebases. This can't land as is, and a plain rebase won't fix it:

  • #425 is on main now, with its own depth-plane-copy path (DepthPlaneCopy in DepthSurface.cpp: 2D arrays, later base slices, guest-backed layers, plus the follow-ups for storage views). The "merge this first, then reconcile #425" order in the description no longer applies. Please rebase onto current main and keep one implementation of the overlapping array behaviour: either extend DepthPlaneCopy with what is only in this PR (zero-read of uncommitted guest pages, HTILE fast-clear invalidation of cached copies, depth/stencil change tracking), or justify and replace it, with the numbers that show why.
  • It conflicts in DepthSurface.cpp, Texture.cpp, Texture.hpp, tests/DepthSurfaceReuse.cpp and docs/dev/TechnicalDebt.md (the debt entries moved to docs/dev/debt/libSceAgcDriver.md).
  • Still open from @oneandonlydean's last review: drop RunDepthClearPass, DepthClearPass and DepthSurface::Clear(const DepthClearPass&) (only tests/Recorder.cpp calls them; they belong with #1395), and remove the new code comment in DepthSurfaceTexture.
  • Keep the 80-layer sparse regression and the Uncharted descriptor-shape tests; they cover the reported cases, so rerun them after the rebase.

Welcome to push again once these are addressed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5501332584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#pullrequestreview-5501332584). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T09:15:18Z. **Review:** CHANGES_REQUESTED --- Thanks for the repeated rebases. This can't land as is, and a plain rebase won't fix it: - #425 is on main now, with its own depth-plane-copy path (`DepthPlaneCopy` in `DepthSurface.cpp`: 2D arrays, later base slices, guest-backed layers, plus the follow-ups for storage views). The "merge this first, then reconcile #425" order in the description no longer applies. Please rebase onto current `main` and keep one implementation of the overlapping array behaviour: either extend `DepthPlaneCopy` with what is only in this PR (zero-read of uncommitted guest pages, HTILE fast-clear invalidation of cached copies, depth/stencil change tracking), or justify and replace it, with the numbers that show why. - It conflicts in `DepthSurface.cpp`, `Texture.cpp`, `Texture.hpp`, `tests/DepthSurfaceReuse.cpp` and `docs/dev/TechnicalDebt.md` (the debt entries moved to `docs/dev/debt/libSceAgcDriver.md`). - Still open from @oneandonlydean's last review: drop `RunDepthClearPass`, `DepthClearPass` and `DepthSurface::Clear(const DepthClearPass&)` (only `tests/Recorder.cpp` calls them; they belong with #1395), and remove the new code comment in `DepthSurfaceTexture`. - Keep the 80-layer sparse regression and the Uncharted descriptor-shape tests; they cover the reported cases, so rerun them after the rebase. Welcome to push again once these are addressed.
adriadam10 commented 2026-10-14 13:55:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:55:52Z.

Review: CHANGES_REQUESTED


Checked the current head against main: it still conflicts in DepthSurface.cpp, DepthSurface.hpp, Texture.cpp, Texture.hpp, tests/Recorder.cpp, tests/DepthSurfaceReuse.cpp and docs/dev/TechnicalDebt.md. The debt entries now live in docs/dev/debt/libSceAgcDriver.md. The code conflicts are not mechanical.

  • main already has DepthPlaneCopy (#425, DepthSurface.cpp), which covers 2D arrays, later base slices and guest-backed layers. This PR adds a second implementation of the same behaviour, and the "merge this first" order no longer applies. Please rebase and keep one implementation: either extend DepthPlaneCopy with what is only here (zero-read of uncommitted guest pages, HTILE fast-clear invalidation of cached copies, depth/stencil change tracking), or justify replacing it with numbers.
  • Still open from @oneandonlydean: drop RunDepthClearPass, DepthClearPass and DepthSurface::Clear(const DepthClearPass&) (only tests/Recorder.cpp calls them; they belong with #1395), and remove the code comment in DepthSurfaceTexture.
  • Keep the 80-layer sparse regression and the Uncharted descriptor-shape tests, and rerun them after the rebase.

Happy to look again once it is rebased onto current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5519070683 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#pullrequestreview-5519070683). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:55:52Z. **Review:** CHANGES_REQUESTED --- Checked the current head against `main`: it still conflicts in `DepthSurface.cpp`, `DepthSurface.hpp`, `Texture.cpp`, `Texture.hpp`, `tests/Recorder.cpp`, `tests/DepthSurfaceReuse.cpp` and `docs/dev/TechnicalDebt.md`. The debt entries now live in `docs/dev/debt/libSceAgcDriver.md`. The code conflicts are not mechanical. - `main` already has `DepthPlaneCopy` (#425, `DepthSurface.cpp`), which covers 2D arrays, later base slices and guest-backed layers. This PR adds a second implementation of the same behaviour, and the "merge this first" order no longer applies. Please rebase and keep one implementation: either extend `DepthPlaneCopy` with what is only here (zero-read of uncommitted guest pages, HTILE fast-clear invalidation of cached copies, depth/stencil change tracking), or justify replacing it with numbers. - Still open from @oneandonlydean: drop `RunDepthClearPass`, `DepthClearPass` and `DepthSurface::Clear(const DepthClearPass&)` (only `tests/Recorder.cpp` calls them; they belong with #1395), and remove the code comment in `DepthSurfaceTexture`. - Keep the 80-layer sparse regression and the Uncharted descriptor-shape tests, and rerun them after the rebase. Happy to look again once it is rebased onto current `main`.
JJenkx commented 2026-10-22 06:31:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T06:31:56Z.


@TibixDev a heads-up on merge order: #9406 adds a check in FlushDepthPlanes (DepthSurface.cpp) and a test in RunDepthSurfaceReuseTests (DepthSurfaceReuse.cpp). The check drops pending depth for a plane whose guest memory was unmapped, instead of throwing storage texture has no committed guest pages.

This PR and #1395 touch the same files, but as far as I can see not that function. Whichever lands second will need a textual merge in those files; nothing else should be needed. If you see an interaction with your array-storage path, please mention it on #9406.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6334375919 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#issuecomment-6334375919). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T06:31:56Z. --- @TibixDev a heads-up on merge order: #9406 adds a check in `FlushDepthPlanes` (`DepthSurface.cpp`) and a test in `RunDepthSurfaceReuseTests` (`DepthSurfaceReuse.cpp`). The check drops pending depth for a plane whose guest memory was unmapped, instead of throwing `storage texture has no committed guest pages`. This PR and #1395 touch the same files, but as far as I can see not that function. Whichever lands second will need a textual merge in those files; nothing else should be needed. If you see an interaction with your array-storage path, please mention it on #9406.
MarcZX10 commented 2026-11-19 04:44:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T04:44:25Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the targeted tests reported by the author cover the added depth-array paths, and the inspected implementation is consistent with the stated scope.

What I ran

Reviewed head 42d1193c467f12a58a09249235929d893a5a30dc using the prepared diff and pinned repository reader. No build or tests were run.

Results

Check Result Note
Diff and source review passed Targeted changed paths inspected
Build and tests not run Test results in description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

No independent runtime, build, or test run was performed. The changed files listed in review/manifest.json were all included and read: CMakeLists.txt, DepthSurface.hpp, State.hpp, Texture.hpp, DepthSurface.cpp, Draw.cpp, Texture.cpp, DepthSurfaceReuse.cpp, Recorder.cpp, SampleArray.comp, and TechnicalDebt.md. No changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5969444855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1368#pullrequestreview-5969444855). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T04:44:25Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the targeted tests reported by the author cover the added depth-array paths, and the inspected implementation is consistent with the stated scope. ## What I ran Reviewed head `42d1193c467f12a58a09249235929d893a5a30dc` using the prepared diff and pinned repository reader. No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | passed | Targeted changed paths inspected | | Build and tests | not run | Test results in description are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No independent runtime, build, or test run was performed. The changed files listed in `review/manifest.json` were all included and read: `CMakeLists.txt`, `DepthSurface.hpp`, `State.hpp`, `Texture.hpp`, `DepthSurface.cpp`, `Draw.cpp`, `Texture.cpp`, `DepthSurfaceReuse.cpp`, `Recorder.cpp`, `SampleArray.comp`, and `TechnicalDebt.md`. No changed files were excluded. ## To get this to a good state Nothing is required.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1368
No description provided.