feat(agc): storage image access to depth planes through a 2D array view from a later slice #5779

Merged
mrfelek merged 1 commit from upstream-pr/5779 into main 2026-10-14 13:51:12 +00:00
mrfelek commented 2026-10-14 10:18:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T10:18:08Z.


What

A storage view of a depth plane that starts above slice 0 (a 2D array T# with BASE_ARRAY above 0) threw storage image access to the depth planes of depth surface ... through a 2D array view of slices N-M is not implemented. #5003 added storage views of depth planes from slice 0 and still refuses these.

LayeredDepthStorage already spans slices 0..last, so the view only needs to know where it starts. The refusal is dropped, the first layer joins the object, and only the slices from the base slice to the last are copied in and out of the depth surfaces. The base slice is part of the cache key, so two views of the same memory from different base slices are separate images, as other views of the same plane already are. The technical-debt entry is updated.

Tests: agc_driver_depth_storage_dispatch now stores through a view from base slice 2 and checks that the other slices stay untouched; agc_driver_depth_storage no longer expects the refusal. Both fail without the change.

Tested

Ubuntu 26.10, GCC 15.3.0, RTX 3080 Ti (NVIDIA 615.71.09), Release, on main c654b199b.

  • agc_driver_depth_storage and agc_driver_depth_storage_dispatch pass, and fail with the source change reverted; agc_driver_depth_storage_reuse, depth_plane_sampling, depth_plane_guest_layers, depth_compare_copy and depth_fast_clear_submit pass.
  • Diablo II: Resurrected (PPSA03912, 01.039.000) stopped at a D16 512x512 array view with BASE_ARRAY=LAST_ARRAY=1 with the refusal above. With this change (and #1186, #5205) it gets past it. Not re-run on today's main.

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; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA03912 #5146
  • GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 615.71.09, Ubuntu 26.10
  • AI-assisted: yes; I reviewed every line and ran the tests

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4856378549 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5779). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-14T10:18:08Z. --- ### What A storage view of a depth plane that starts above slice 0 (a 2D array T# with BASE_ARRAY above 0) threw `storage image access to the depth planes of depth surface ... through a 2D array view of slices N-M is not implemented`. #5003 added storage views of depth planes from slice 0 and still refuses these. `LayeredDepthStorage` already spans slices 0..last, so the view only needs to know where it starts. The refusal is dropped, the first layer joins the object, and only the slices from the base slice to the last are copied in and out of the depth surfaces. The base slice is part of the cache key, so two views of the same memory from different base slices are separate images, as other views of the same plane already are. The technical-debt entry is updated. Tests: `agc_driver_depth_storage_dispatch` now stores through a view from base slice 2 and checks that the other slices stay untouched; `agc_driver_depth_storage` no longer expects the refusal. Both fail without the change. ### Tested Ubuntu 26.10, GCC 15.3.0, RTX 3080 Ti (NVIDIA 615.71.09), Release, on main c654b199b. - `agc_driver_depth_storage` and `agc_driver_depth_storage_dispatch` pass, and fail with the source change reverted; `agc_driver_depth_storage_reuse`, `depth_plane_sampling`, `depth_plane_guest_layers`, `depth_compare_copy` and `depth_fast_clear_submit` pass. - Diablo II: Resurrected (PPSA03912, 01.039.000) stopped at a D16 512x512 array view with BASE_ARRAY=LAST_ARRAY=1 with the refusal above. With this change (and #1186, #5205) it gets past it. Not re-run on today's main. ### Checklist - [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 - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA03912 #5146 - [x] GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 615.71.09, Ubuntu 26.10 - [x] AI-assisted: yes; I reviewed every line and ran the tests AI-assisted; the runs are from my machine.
mrfelek commented 2026-10-14 10:56:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T10:56:46Z.


Check on today's main: Diablo II: Resurrected (PPSA03912, 01.039.000), Linux, RTX 3080 Ti (NVIDIA 615.71.09), main 3e577edac with #1186 (head merged locally; one docs conflict in docs/dev/debt/libSceAgcDriver.md, none in code) and this PR on top. Offline > New Character reaches the Rogue Encampment with the character on screen (second attempt of three; the first two launches did not reach it: the game's known load-time crash on the first, a libSceHttp crash after about 10 minutes in game on the second). The storage image access to depth/stencil surface ... slices=1-1 error from before this PR does not appear.

In game, measured on the third run: 39.1 presents per 10 s (windows 40, 39, 39, 39, 39, 39, 39). The depth tests pass on the combination (9 of 9 depth tests; agc_driver_depth_storage and agc_driver_depth_storage_dispatch fail with this PR's source change reverted).

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166773240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5779#issuecomment-6166773240). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-14T10:56:46Z. --- Check on today's `main`: Diablo II: Resurrected (PPSA03912, 01.039.000), Linux, RTX 3080 Ti (NVIDIA 615.71.09), `main` 3e577edac with #1186 (head merged locally; one docs conflict in `docs/dev/debt/libSceAgcDriver.md`, none in code) and this PR on top. Offline > New Character reaches the Rogue Encampment with the character on screen (second attempt of three; the first two launches did not reach it: the game's known load-time crash on the first, a `libSceHttp` crash after about 10 minutes in game on the second). The `storage image access to depth/stencil surface ... slices=1-1` error from before this PR does not appear. In game, measured on the third run: 39.1 presents per 10 s (windows 40, 39, 39, 39, 39, 39, 39). The depth tests pass on the combination (9 of 9 `depth` tests; `agc_driver_depth_storage` and `agc_driver_depth_storage_dispatch` fail with this PR's source change reverted). AI-assisted; the runs are from my machine.
adriadam10 commented 2026-10-14 13:33:12 +00:00 (Migrated from github.com)

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


Checked on Linux (AMD, RADV): agc_driver_depth_storage, agc_driver_depth_storage_dispatch and agc_driver_depth_storage_reuse pass, and the first two fail with the source change reverted. The firstLayer loop bound and the base slice in the cache key look right; the layer-pitch check still guards the remaining case. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169574644 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5779#issuecomment-6169574644). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T13:33:12Z. --- Checked on Linux (AMD, RADV): `agc_driver_depth_storage`, `agc_driver_depth_storage_dispatch` and `agc_driver_depth_storage_reuse` pass, and the first two fail with the source change reverted. The firstLayer loop bound and the base slice in the cache key look right; the layer-pitch check still guards the remaining case. Merging once the full Build is green.
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!5779
No description provided.