fix(agc): sample a cube array over depth surfaces through their depth planes #12207

Merged
XairRrR merged 1 commit from upstream-pr/12207 into main 2026-10-29 20:21:05 +00:00
XairRrR commented 2026-10-28 03:43:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-28T03:43:09Z.


What

A cube T# whose last array slice is 6n - 1 is a cube array of n cubes. When it lies over a depth surface, the depth plane path (DepthSurfaceTexture) accepted one cube only (last array slice 0 or 5) and threw sampling the depth planes of depth surface ... is not implemented for the rest. It now gathers all 6n slices into the 2D array copy, the layout the colour texture path already uses for cube arrays. The refusal message also names the last array slice, whether the view reads depth bits, and the copy format, since the slice count it printed for a cube was always 6.

PPSA05684 (Uncharted: Legacy of Thieves Collection) samples a two-cube D32 shadow array this way (last array slice 11) right after Uncharted 4's orphanage chapter loads.

Tested

Arch Linux 7.2.11-zen, GCC 16.2.1, Ninja, Release, on main 3ca715ee15:

  • agc_driver_depth_plane_guest_layers gains RunCubeArrayGather: two cubes of depth surfaces over 12 slices, sampled through one cube array T#, each slice read back. With DepthSurface.cpp from main it fails with the title's error (... dimension 3, 6 slices, levels 0-0, base slice 0 is not implemented).
  • Full ctest -j8 (this branch together with my five other branches of today, on the same main): 2619 of 2620 pass; agc_driver_mesh_barycentric_emulation fails the same way on main on this GPU (the pixel shader did not emulate barycentrics).
  • tools/check_conventions.py --base origin/main passes, with one debt-length warning on the depth plane copies entry this edits (already 2005 characters on main).
  • PPSA05684: the orphanage chapter loads and plays past the point where it threw.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (#11507 changes cube descriptors with fewer than six slices in the texture decode; it does not touch this path)
  • Fixes: none
  • Unblocks: PPSA05684 #4001 (throw when the orphanage chapter loads)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti SUPER, driver 615.78.08, Arch Linux 7.2.11-zen
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5044855273 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12207). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-28T03:43:09Z. --- ### What A cube T# whose last array slice is 6n - 1 is a cube array of n cubes. When it lies over a depth surface, the depth plane path (`DepthSurfaceTexture`) accepted one cube only (last array slice 0 or 5) and threw `sampling the depth planes of depth surface ... is not implemented` for the rest. It now gathers all 6n slices into the 2D array copy, the layout the colour texture path already uses for cube arrays. The refusal message also names the last array slice, whether the view reads depth bits, and the copy format, since the slice count it printed for a cube was always 6. PPSA05684 (Uncharted: Legacy of Thieves Collection) samples a two-cube D32 shadow array this way (last array slice 11) right after Uncharted 4's orphanage chapter loads. ### Tested Arch Linux 7.2.11-zen, GCC 16.2.1, Ninja, Release, on `main` 3ca715ee15: - `agc_driver_depth_plane_guest_layers` gains `RunCubeArrayGather`: two cubes of depth surfaces over 12 slices, sampled through one cube array T#, each slice read back. With `DepthSurface.cpp` from `main` it fails with the title's error (`... dimension 3, 6 slices, levels 0-0, base slice 0 is not implemented`). - Full `ctest -j8` (this branch together with my five other branches of today, on the same `main`): 2619 of 2620 pass; `agc_driver_mesh_barycentric_emulation` fails the same way on `main` on this GPU (`the pixel shader did not emulate barycentrics`). - `tools/check_conventions.py --base origin/main` passes, with one `debt-length` warning on the depth plane copies entry this edits (already 2005 characters on `main`). - PPSA05684: the orphanage chapter loads and plays past the point where it threw. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#11507 changes cube descriptors with fewer than six slices in the texture decode; it does not touch this path) - [x] Fixes: none - [x] Unblocks: PPSA05684 #4001 (throw when the orphanage chapter loads) - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti SUPER, driver 615.78.08, Arch Linux 7.2.11-zen - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 04:24:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T04:24:30Z.

Review: CHANGES_REQUESTED


The inclusive LAST_ARRAY check accepts only cube face counts divisible by six, and the new fixture covers gathering 12 slices plus rejecting an 8-slice cube. I found no separate defect by static inspection. This branch is 60 commits behind current main; please rebase and rerun agc_driver_depth_plane_guest_layers on current main and the rebased change. As an AGC change, also provide the repository-required paired validation-layer run and confirm the rebased change adds no VUID- errors.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677771917 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12207#pullrequestreview-5677771917). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T04:24:30Z. **Review:** CHANGES_REQUESTED --- The inclusive `LAST_ARRAY` check accepts only cube face counts divisible by six, and the new fixture covers gathering 12 slices plus rejecting an 8-slice cube. I found no separate defect by static inspection. This branch is 60 commits behind current `main`; please rebase and rerun `agc_driver_depth_plane_guest_layers` on current main and the rebased change. As an AGC change, also provide the repository-required paired validation-layer run and confirm the rebased change adds no `VUID-` errors.
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!12207
No description provided.