feat(libSceAgcDriver): take a one-layer 2D array view of a depth surface plane as the plane #2076

Merged
jdmagic merged 2 commits from upstream-pr/2076 into main 2026-10-13 11:11:01 +00:00
jdmagic commented 2026-10-09 06:54:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jdmagic on 2026-10-09T06:54:11Z.


What

Depends on: #4500; its two commits are included. Only the last commit belongs to this PR.

#4500 takes a storage view of a depth or stencil plane for the depth surface only when the view is a 2D image. A 2D array view of layer 0 with one layer and the plane's extent and format is the same plane, but it took the ordinary storage path and read guest memory instead of the plane.

  • Such a view now gets the plane's storage image, seeded and copied back as #4500 does for a 2D view. A view with more layers, or another extent or format, still takes the ordinary path.
  • The plane's storage image is recreated when the view's dimension changes.
  • agc_driver_depth_storage: a one-layer 2D array view of the depth plane reads back depth stored into the surface (0.5 while guest memory holds 0.75), a one-layer 2D array view of the stencil plane reads back the cleared stencil over zeroed guest memory, and a two-layer array view of the stencil plane is not taken for the surface.

Sackboy: A Big Adventure (PPSA01289) binds the stencil plane of its 2880x1620 D32_SFLOAT_S8_UINT surface as a one-layer R8_UINT 2D array from a compute shader during presentation.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), NVIDIA GPU, on #4500's head cdfba514 (main 5efd09af + #4500).

  • agc_driver_depth_storage, agc_driver_depth_storage_reuse, agc_driver_depth_compare_copy, agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit, agc_driver_depth_bias_per_face, agc_driver_graphics: 7/7 passed. The full ctest was not run on this branch.
  • On #4500 alone (without this commit), agc_driver_depth_storage fails with a one-layer 2D array view of the depth plane was not taken for the depth surface.
  • PPSA01289: the title's storage views of that shape are in its logs (2880x1620, guest format 5, 2D array, one layer). The title has not been rerun on this head.

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 in TechnicalDebt
  • 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: #4500
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4797132557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076). Originally posted by [jdmagic](https://github.com/jdmagic) on 2026-10-09T06:54:11Z. --- ### What Depends on: #4500; its two commits are included. Only the last commit belongs to this PR. #4500 takes a storage view of a depth or stencil plane for the depth surface only when the view is a 2D image. A 2D array view of layer 0 with one layer and the plane's extent and format is the same plane, but it took the ordinary storage path and read guest memory instead of the plane. - Such a view now gets the plane's storage image, seeded and copied back as #4500 does for a 2D view. A view with more layers, or another extent or format, still takes the ordinary path. - The plane's storage image is recreated when the view's dimension changes. - `agc_driver_depth_storage`: a one-layer 2D array view of the depth plane reads back depth stored into the surface (0.5 while guest memory holds 0.75), a one-layer 2D array view of the stencil plane reads back the cleared stencil over zeroed guest memory, and a two-layer array view of the stencil plane is not taken for the surface. Sackboy: A Big Adventure (PPSA01289) binds the stencil plane of its 2880x1620 `D32_SFLOAT_S8_UINT` surface as a one-layer `R8_UINT` 2D array from a compute shader during presentation. ### Tested Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), NVIDIA GPU, on #4500's head cdfba514 (main 5efd09af + #4500). - `agc_driver_depth_storage`, `agc_driver_depth_storage_reuse`, `agc_driver_depth_compare_copy`, `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit`, `agc_driver_depth_bias_per_face`, `agc_driver_graphics`: 7/7 passed. The full `ctest` was not run on this branch. - On #4500 alone (without this commit), `agc_driver_depth_storage` fails with `a one-layer 2D array view of the depth plane was not taken for the depth surface`. - PPSA01289: the title's storage views of that shape are in its logs (2880x1620, guest format 5, 2D array, one layer). The title has not been rerun on this head. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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: #4500 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fisherjoey commented 2026-10-09 18:09:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T18:09:25Z.


For reviewers: #2325 (mine) duplicates the stencil-plane part of this PR. I've closed #2325. Its two extra pieces, an HTILE stencil fast clear and a stencil storage test, are in commit 598f7883 if you want to cherry-pick them.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086578485 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6086578485). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T18:09:25Z. --- For reviewers: #2325 (mine) duplicates the stencil-plane part of this PR. I've closed #2325. Its two extra pieces, an HTILE stencil fast clear and a stencil storage test, are in commit 598f7883 if you want to cherry-pick them. AI-assisted: yes
Mouhand-Kaddo commented 2026-10-10 10:05:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:05:35Z.


Additional platform validation on standalone PR head 3313464f115a407aa163cb73edaebdad3128a5e7:

Linux: passed — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja.

Release / BUILD_TESTING=ON: built the selected test targets; 1 CTest cases, 0 failures, 0 CTest skips.

Tests: agc_driver_graphics.

Reproduce after building the test targets: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_graphics$".

Vulkan: Mesa lavapipe 26.2.4 software Vulkan; no native Linux GPU/retail-title validation.

Internal limitation: write-watched guest-heap mirror subcases returned early because WSL userfaultfd async write protection is unavailable. The other graphics assertions ran; zero CTest skips does not include this internal early return.

Integration limitation: a local merge against main 948a526c2 has source conflicts; these results validate the standalone PR head, not a resolved merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096397902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6096397902). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-10T10:05:35Z. --- <!-- anyps5-platform-validation:3313464f115a407aa163cb73edaebdad3128a5e7 --> Additional platform validation on standalone PR head `3313464f115a407aa163cb73edaebdad3128a5e7`: **Linux: passed** — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja. Release / `BUILD_TESTING=ON`: built the selected test targets; 1 CTest cases, 0 failures, 0 CTest skips. Tests: `agc_driver_graphics`. Reproduce after building the test targets: `ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_graphics$"`. Vulkan: Mesa lavapipe 26.2.4 software Vulkan; no native Linux GPU/retail-title validation. Internal limitation: write-watched guest-heap mirror subcases returned early because WSL userfaultfd async write protection is unavailable. The other graphics assertions ran; zero CTest skips does not include this internal early return. Integration limitation: a local merge against main `948a526c2` has source conflicts; these results validate the standalone PR head, not a resolved merge.
adriadam10 commented 2026-10-11 11:40:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:40:54Z.

Review: DISMISSED


Reviewed the commit that belongs to this PR (3313464f1; the rest is the stack under #425/#2053).

  • No test. The body says the stencil storage path isn't covered, and this is the whole fix (ShaderResources.cpp:568 stops throwing, DepthSurface.cpp SeedStorageFromStencil is new). A game fix needs a Linux test that fails without it: seed a storage image from a depth surface's stencil plane, dispatch, read it back and check the values, plus a view that must still throw (e.g. R16 or a mipped image). @fisherjoey offered one in 598f7883 (from the closed #2325) that can be cherry-picked, credited.
  • This head conflicts with main (DepthSurface.cpp/.hpp, State.hpp, Texture.hpp, ShaderResources.cpp, tests/Graphics.cpp, DepthFastClearHarness.hpp) and depends on #419, #425, #454, #1186, #1189 and #2053, all still open. Once those are merged, please rebase so only this commit remains.

The change itself reads fine: R8 UINT/UNORM/SINT/SNORM at layer 0 with the surface's extent, everything else throws naming the plane. Happy to re-review once the test is in and the bases have landed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5483162325 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#pullrequestreview-5483162325). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T11:40:54Z. **Review:** DISMISSED --- Reviewed the commit that belongs to this PR (3313464f1; the rest is the stack under #425/#2053). - No test. The body says the stencil storage path isn't covered, and this is the whole fix (`ShaderResources.cpp:568` stops throwing, `DepthSurface.cpp` `SeedStorageFromStencil` is new). A game fix needs a Linux test that fails without it: seed a storage image from a depth surface's stencil plane, dispatch, read it back and check the values, plus a view that must still throw (e.g. R16 or a mipped image). @fisherjoey offered one in 598f7883 (from the closed #2325) that can be cherry-picked, credited. - This head conflicts with `main` (`DepthSurface.cpp/.hpp`, `State.hpp`, `Texture.hpp`, `ShaderResources.cpp`, `tests/Graphics.cpp`, `DepthFastClearHarness.hpp`) and depends on #419, #425, #454, #1186, #1189 and #2053, all still open. Once those are merged, please rebase so only this commit remains. The change itself reads fine: R8 UINT/UNORM/SINT/SNORM at layer 0 with the surface's extent, everything else throws naming the plane. Happy to re-review once the test is in and the bases have landed.
queeeef commented 2026-10-11 17:21:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-11T17:21:54Z.


Palworld (PPSA23126, 01.102.999, Unreal Engine) needs this: with #425 (and the other fixes in #2648) presentation stops at

compute shader 0x144106ea00: AGC graphics: storage access to a depth surface's stencil plane is not implemented

The storage views over stencil planes in one run: 1000x1000, 2048x2048 and 2536x1428, all guest format 5.

I worked around it locally with an ordinary storage image over guest memory (b8321ec8; wrong data, only for finding later stops). The title then reaches character creation and later faults in title code (#2648, item 10), which may come from that wrong stencil data. I have not yet run this PR's current head with the title.

Windows 11 Pro 26300, RTX 2080 Ti, MinGW-w64 GCC 15.2.0 (WinLibs r7), RelWithDebInfo. AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111648281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6111648281). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-11T17:21:54Z. --- Palworld (PPSA23126, 01.102.999, Unreal Engine) needs this: with #425 (and the other fixes in #2648) presentation stops at ``` compute shader 0x144106ea00: AGC graphics: storage access to a depth surface's stencil plane is not implemented ``` The storage views over stencil planes in one run: 1000x1000, 2048x2048 and 2536x1428, all guest format 5. I worked around it locally with an ordinary storage image over guest memory ([`b8321ec8`](https://github.com/queeeef/AnyPS5/commit/b8321ec82a57176984ae78cd2296407cbd7bb351); wrong data, only for finding later stops). The title then reaches character creation and later faults in title code (#2648, item 10), which may come from that wrong stencil data. I have not yet run this PR's current head with the title. Windows 11 Pro 26300, RTX 2080 Ti, MinGW-w64 GCC 15.2.0 (WinLibs r7), RelWithDebInfo. AI-assisted (Claude Code).
jdmagic commented 2026-10-11 19:03:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jdmagic on 2026-10-11T19:03:04Z.


Thanks for the review. Both points are addressed; details are in the updated description.

  • The refused-view check uses an R16_UINT image_store: a 16-bit image_load at the stencil address isn't refused today, so a load can't serve as the case that must throw.
  • The branch is now main a11c8f7f + #425's four commits + this PR's three, and merges cleanly; it no longer depends on #419, #454, #1186, #1189 or #2053. I'll rebase again once #425 lands so only this PR's commits remain.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112576545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6112576545). Originally posted by [jdmagic](https://github.com/jdmagic) on 2026-10-11T19:03:04Z. --- Thanks for the review. Both points are addressed; details are in the updated description. - The refused-view check uses an `R16_UINT` `image_store`: a 16-bit `image_load` at the stencil address isn't refused today, so a load can't serve as the case that must throw. - The branch is now main a11c8f7f + #425's four commits + this PR's three, and merges cleanly; it no longer depends on #419, #454, #1186, #1189 or #2053. I'll rebase again once #425 lands so only this PR's commits remain.
queeeef commented 2026-10-12 15:17:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-12T15:17:22Z.


A case this PR should handle: a storage image at a stencil plane's address that is not the stencil plane.

In Palworld (PPSA23126), with this PR's SeedStorageFromStencil (unchanged at f08fc2291) merged locally, a 2536x1428 depth surface (D32_SFLOAT_S8_UINT) has its stencil plane at 0x3027630000. Later in the frame the title places a 2536x1428 A2B10G10R10 color target at that same address: Unreal's transient allocator reuses the memory. That image is 14.5 MB, the stencil plane 3.6 MB.

cachedStorageTexture calls SeedStorageFromStencil for any storage image whose base is a stencil plane's address, and Transfer then throws. This happened 36 times in one run:

storage image access to the stencil plane of depth surface 0x3027630000 (2536x1428, vk format 130) as a 2536x1428 image of vk format 64, dimension 1, 1 mips is not implemented

The color target stays non-resident ([gpu] color target ... stays non-resident), and textures over it keep the snapshot path.

Seeding only an image shaped like the plane (an R8 format, one slice, one mip, the surface's extent) and treating anything else as reused memory fixes it locally:

@@ void SeedStorageFromStencil(const Context& context, const std::shared_ptr<StorageTexture>& storage) {
     if (found == list.rend()) return;
     auto& surface = **found;
+    const auto& descriptor = storage->Descriptor();
+    const auto storageFormat = storage->StorageFormat();
+    const bool r8 = storageFormat == VK_FORMAT_R8_UINT || storageFormat == VK_FORMAT_R8_UNORM || storageFormat == VK_FORMAT_R8_SINT || storageFormat == VK_FORMAT_R8_SNORM;
+    const bool oneSlice = descriptor.dimension == TextureDimension::k2D || (descriptor.dimension == TextureDimension::k2DArray && descriptor.depthOrLastArray == 0);
+    if (!r8 || !oneSlice || descriptor.mipCount != 1 || descriptor.width != surface.target.extent.width || descriptor.height != surface.target.extent.height) return;
     if (surface.stencilSeeded == storage.get() && surface.stencilWriter.lock() == storage) return;

The condition is the one Transfer already checks for the stencil aspect, so a plane-shaped image is seeded exactly as before, and the depth and stencil tests still pass.

Limits of this report:

  • The title hit this in one of eight runs, so the runs since the patch show no refusal, but they don't prove the patch is what removed it.
  • I haven't written a test for the reuse case. If you prefer it as a commit on your branch, I can open a PR against it.

AI-assisted (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127164690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6127164690). Originally posted by [queeeef](https://github.com/queeeef) on 2026-10-12T15:17:22Z. --- A case this PR should handle: a storage image at a stencil plane's address that is not the stencil plane. In Palworld (PPSA23126), with this PR's `SeedStorageFromStencil` (unchanged at `f08fc2291`) merged locally, a 2536x1428 depth surface (`D32_SFLOAT_S8_UINT`) has its stencil plane at `0x3027630000`. Later in the frame the title places a 2536x1428 `A2B10G10R10` color target at that same address: Unreal's transient allocator reuses the memory. That image is 14.5 MB, the stencil plane 3.6 MB. `cachedStorageTexture` calls `SeedStorageFromStencil` for any storage image whose base is a stencil plane's address, and `Transfer` then throws. This happened 36 times in one run: ``` storage image access to the stencil plane of depth surface 0x3027630000 (2536x1428, vk format 130) as a 2536x1428 image of vk format 64, dimension 1, 1 mips is not implemented ``` The color target stays non-resident (`[gpu] color target ... stays non-resident`), and textures over it keep the snapshot path. Seeding only an image shaped like the plane (an R8 format, one slice, one mip, the surface's extent) and treating anything else as reused memory fixes it locally: ```diff @@ void SeedStorageFromStencil(const Context& context, const std::shared_ptr<StorageTexture>& storage) { if (found == list.rend()) return; auto& surface = **found; + const auto& descriptor = storage->Descriptor(); + const auto storageFormat = storage->StorageFormat(); + const bool r8 = storageFormat == VK_FORMAT_R8_UINT || storageFormat == VK_FORMAT_R8_UNORM || storageFormat == VK_FORMAT_R8_SINT || storageFormat == VK_FORMAT_R8_SNORM; + const bool oneSlice = descriptor.dimension == TextureDimension::k2D || (descriptor.dimension == TextureDimension::k2DArray && descriptor.depthOrLastArray == 0); + if (!r8 || !oneSlice || descriptor.mipCount != 1 || descriptor.width != surface.target.extent.width || descriptor.height != surface.target.extent.height) return; if (surface.stencilSeeded == storage.get() && surface.stencilWriter.lock() == storage) return; ``` The condition is the one `Transfer` already checks for the stencil aspect, so a plane-shaped image is seeded exactly as before, and the depth and stencil tests still pass. Limits of this report: - The title hit this in one of eight runs, so the runs since the patch show no refusal, but they don't prove the patch is what removed it. - I haven't written a test for the reuse case. If you prefer it as a commit on your branch, I can open a PR against it. AI-assisted (Claude Code)
ee6aba54 commented 2026-10-12 22:34:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-12T22:34:18Z.


@jdmagic for coordination, since the two overlap: #4500 adds storage images over both planes of a depth surface. The stencil plane is bound as an R8_UINT image of the surface's extent, seeded with a copy of the stencil aspect before the dispatch and copied back at write-back. I missed this pull request when I opened #4500. The depth-plane storage path of #425 that this one builds on has since been taken out of #425 (its author describes the split on #4500).

What this pull request covers beyond #4500:

  • 8-bit UNORM, SINT and SNORM views of the stencil plane, and layer 0 of a 2D array;
  • dropping a stencil writer when a fast clear covers the stencil aspect;
  • agc_driver_stencil_plane_storage with the R16_UINT refusal.

The case @queeeef describes (a 2536x1428 A2B10G10R10 image placed at the stencil plane's address) takes the ordinary storage path in #4500, because a view whose format or extent is not the plane's is not treated as the plane.

If that works for you, these parts could build on #4500 once it merges. If you would rather structure it differently, I can adjust #4500.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6133899807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6133899807). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-12T22:34:18Z. --- @jdmagic for coordination, since the two overlap: #4500 adds storage images over both planes of a depth surface. The stencil plane is bound as an `R8_UINT` image of the surface's extent, seeded with a copy of the stencil aspect before the dispatch and copied back at write-back. I missed this pull request when I opened #4500. The depth-plane storage path of #425 that this one builds on has since been taken out of #425 (its author describes the split on #4500). What this pull request covers beyond #4500: - 8-bit `UNORM`, `SINT` and `SNORM` views of the stencil plane, and layer 0 of a 2D array; - dropping a stencil writer when a fast clear covers the stencil aspect; - `agc_driver_stencil_plane_storage` with the `R16_UINT` refusal. The case @queeeef describes (a 2536x1428 `A2B10G10R10` image placed at the stencil plane's address) takes the ordinary storage path in #4500, because a view whose format or extent is not the plane's is not treated as the plane. If that works for you, these parts could build on #4500 once it merges. If you would rather structure it differently, I can adjust #4500.
jdmagic commented 2026-10-12 22:46:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jdmagic on 2026-10-12T22:46:49Z.


@ee6aba54 Thanks, building on #4500 works for me. I reworked this PR onto it; the description is updated.

Of the parts you listed, only the one-layer 2D array view is still needed: PPSA01289 binds its stencil plane as a one-layer R8_UINT 2D array, which #4500 sends down the ordinary path. This PR is now that one commit on top of #4500. The rest is dropped:

  • the stencil writer belonged to the old lazy copy-back, which #4500 replaces with a copy at write-back;
  • no title I know of binds the plane as 8-bit UNORM, SINT or SNORM;
  • the R16_UINT refusal contradicts #4500 sending a view of another format down the ordinary path, which also covers @queeeef's A2B10G10R10 case.

@fisherjoey, thanks for 598f7883. Its coverage is now in #4500's agc_driver_depth_storage, so it is no longer on this branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134082335 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6134082335). Originally posted by [jdmagic](https://github.com/jdmagic) on 2026-10-12T22:46:49Z. --- @ee6aba54 Thanks, building on #4500 works for me. I reworked this PR onto it; the description is updated. Of the parts you listed, only the one-layer 2D array view is still needed: PPSA01289 binds its stencil plane as a one-layer `R8_UINT` 2D array, which #4500 sends down the ordinary path. This PR is now that one commit on top of #4500. The rest is dropped: - the stencil writer belonged to the old lazy copy-back, which #4500 replaces with a copy at write-back; - no title I know of binds the plane as 8-bit `UNORM`, `SINT` or `SNORM`; - the `R16_UINT` refusal contradicts #4500 sending a view of another format down the ordinary path, which also covers @queeeef's `A2B10G10R10` case. @fisherjoey, thanks for 598f7883. Its coverage is now in #4500's `agc_driver_depth_storage`, so it is no longer on this branch.
adriadam10 commented 2026-10-13 09:18:42 +00:00 (Migrated from github.com)

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

Review: DISMISSED


#4500 is merged, and it landed with two extra commits from @oneandonlydean (26dfc464a7, 848b97b611) that this PR's last commit doesn't contain. It conflicts with main in DepthSurface.cpp, tests/DepthSurfaceReuse.cpp and tests/execution/DepthStorage.cpp (add/add), and it isn't a mechanical rebase:

  • 26dfc464a7 makes a storage view that is not 2D throw storage image access to depth/stencil surface ... is not implemented (DepthSurface.cpp:165). This PR's change is to take a one-layer 2D array view as the plane, so it has to be reworked as a narrow exception to that check (layer 0, one layer, plane extent and format), keeping the throw for every other non-2D view.
  • Main now has agc_driver_depth_storage_dispatch (dispatch-based test with the refusals). Please put the one-layer array cases (depth, stencil, and the two-layer view that must still throw) there as well as in agc_driver_depth_storage, and check the new tests fail without the change.
  • StoreBack through a view replaced by another view of the same plane now throws; say what happens when the dimension change recreates the storage image (the "recreated when the view's dimension changes" part) with respect to that.
  • Dean noted that #2491 will conflict in DepthSurface.cpp and that StoreBack has to bump the write serial there; keep that in mind when rebasing.

Please rebase on current main so the PR is only its own commit, rerun the depth/agc tests, and update the body's Tested section for that head (it now says it was tested on #4500's old head and the full ctest wasn't run).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5501373203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#pullrequestreview-5501373203). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T09:18:42Z. **Review:** DISMISSED --- #4500 is merged, and it landed with two extra commits from @oneandonlydean (`26dfc464a7`, `848b97b611`) that this PR's last commit doesn't contain. It conflicts with main in `DepthSurface.cpp`, `tests/DepthSurfaceReuse.cpp` and `tests/execution/DepthStorage.cpp` (add/add), and it isn't a mechanical rebase: - `26dfc464a7` makes a storage view that is not 2D throw `storage image access to depth/stencil surface ... is not implemented` (`DepthSurface.cpp:165`). This PR's change is to take a one-layer 2D array view as the plane, so it has to be reworked as a narrow exception to that check (layer 0, one layer, plane extent and format), keeping the throw for every other non-2D view. - Main now has `agc_driver_depth_storage_dispatch` (dispatch-based test with the refusals). Please put the one-layer array cases (depth, stencil, and the two-layer view that must still throw) there as well as in `agc_driver_depth_storage`, and check the new tests fail without the change. - `StoreBack` through a view replaced by another view of the same plane now throws; say what happens when the dimension change recreates the storage image (the "recreated when the view's dimension changes" part) with respect to that. - Dean noted that #2491 will conflict in `DepthSurface.cpp` and that `StoreBack` has to bump the write serial there; keep that in mind when rebasing. Please rebase on current `main` so the PR is only its own commit, rerun the depth/agc tests, and update the body's Tested section for that head (it now says it was tested on #4500's old head and the full ctest wasn't run).
github-actions[bot] commented 2026-10-13 10:32:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T10:32:37Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#4551 docs/dev/debt/libSceAgcDriver.md L28-29
#5003 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L162-167
core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp L48, L218, L220, L222-224, L304
docs/dev/debt/libSceAgcDriver.md L29
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143609177 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6143609177). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T10:32:37Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4551 | `docs/dev/debt/libSceAgcDriver.md` [L28-29](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/docs/dev/debt/libSceAgcDriver.md#L28-L29) | | | | #5003 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L162-167](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L162-L167)<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp` [L48](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp#L48), [L218](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp#L218), [L220](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp#L220), [L222-224](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp#L222-L224), [L304](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/core/libs/prx/libSceAgcDriver/tests/execution/DepthStorageDispatch.cpp#L304)<br>`docs/dev/debt/libSceAgcDriver.md` [L29](https://github.com/boykopovar/AnyPS5/blob/b1328fc0f9012e820fb92c8fdbbb4af02007bd48/docs/dev/debt/libSceAgcDriver.md#L29) | | |
oneandonlydean commented 2026-10-13 11:10:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T11:10:29Z.


Rebased onto main 77b9f7270c so only your commit remains, and added one on top for the review:

  • DepthSurface.cpp: a 2D array view is taken as the plane only at layer 0 with one layer; every other non-2D view still throws storage image access to depth/stencil surface ... is not implemented. Your commit keeps the recreate when the view's dimension changes.
  • StoreBack: a one-layer array view replaces an earlier 2D view of the plane like any other view, so a store back through the replaced 2D view throws. agc_driver_depth_storage now checks that, and that two-layer and layer-1 views throw.
  • agc_driver_depth_storage_dispatch: one-layer array views of the depth and stencil planes are dispatched and checked with depth and stencil tests, and a two-layer view still throws. Both tests fail on main and pass here. The debt entry in docs/dev/debt/libSceAgcDriver.md now names the one-layer case.
    Your commit keeps your authorship. Depth tests and the agc_/guest_ ctest set pass on Linux. Merging.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6144233231 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2076#issuecomment-6144233231). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T11:10:29Z. --- Rebased onto main 77b9f7270c so only your commit remains, and added one on top for the review: - `DepthSurface.cpp`: a 2D array view is taken as the plane only at layer 0 with one layer; every other non-2D view still throws `storage image access to depth/stencil surface ... is not implemented`. Your commit keeps the recreate when the view's dimension changes. - StoreBack: a one-layer array view replaces an earlier 2D view of the plane like any other view, so a store back through the replaced 2D view throws. `agc_driver_depth_storage` now checks that, and that two-layer and layer-1 views throw. - `agc_driver_depth_storage_dispatch`: one-layer array views of the depth and stencil planes are dispatched and checked with depth and stencil tests, and a two-layer view still throws. Both tests fail on main and pass here. The debt entry in `docs/dev/debt/libSceAgcDriver.md` now names the one-layer case. Your commit keeps your authorship. Depth tests and the `agc_`/`guest_` ctest set pass on Linux. Merging.
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!2076
No description provided.