feat(libSceAgcDriver): storage image access to depth surfaces #4500

Merged
ee6aba54 merged 5 commits from upstream-pr/4500 into main 2026-10-13 03:50:54 +00:00
ee6aba54 commented 2026-10-12 13:39:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-12T13:39:50Z.


What

Compute shaders bind the depth and stencil planes of a depth surface as storage images, to read the depth or to write it before later draws test against it. The driver kept depth on the GPU and refused such bindings ("storage image access to depth/stencil surface ... is not implemented").

A depth surface now owns one storage image per plane (R32_SFLOAT or R16_UNORM for depth, R8_UINT for stencil). Binding applies a pending fast clear and copies the plane into the storage image through a staging buffer (the depth image is created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT for that copy); a written element is copied back into the depth image during write-back, so the next draw sees the shader's depth. A view of another extent, or of a format that is not the plane's, takes the ordinary texture path, as DepthSurfaceAt already decides for sampled views; a view of another level still throws.

A D16_UNORM_S8_UINT surface that the device stores as D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT holds 4 bytes per depth texel, so a storage view of its depth plane throws, naming both formats; its stencil plane is supported.

This is the storage counterpart of the depth copy that comparison sampling takes since d024709cf. The refused binding is the stop reported in #1409 (PPSA10112); that title is not tested here.

Tested

  • Ubuntu 24.04, Linux 7.0, GCC 13.3, Release, based on 1c5e62878. ctest: 996 tests pass.
  • New agc_driver_depth_storage (RTX 5080) checks both copy directions for depth and stencil, the reuse of the storage image, the fall-through for another extent or format and the refusal of another level; agc_driver_depth_storage_reuse and agc_driver_depth_compare_copy still pass.
  • agc_driver_graphics: on a device without D16_UNORM_S8_UINT, a storage view of the depth plane of a D16 surface with stencil throws.
  • PPSA15304 (engine: Unreal Engine 5): copies depth and stencil of a 2848x1600 D32_SFLOAT_S8_UINT target through storage images every frame; the dispatch that stopped the title now runs, and together with #4586 and layered rendering into 3D color targets (the change #1077 proposes) the title reaches its main menu.
  • Windows not built or tested.

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: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4830239388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-12T13:39:50Z. --- ### What Compute shaders bind the depth and stencil planes of a depth surface as storage images, to read the depth or to write it before later draws test against it. The driver kept depth on the GPU and refused such bindings ("storage image access to depth/stencil surface ... is not implemented"). A depth surface now owns one storage image per plane (`R32_SFLOAT` or `R16_UNORM` for depth, `R8_UINT` for stencil). Binding applies a pending fast clear and copies the plane into the storage image through a staging buffer (the depth image is created with `VK_IMAGE_USAGE_TRANSFER_SRC_BIT` for that copy); a written element is copied back into the depth image during write-back, so the next draw sees the shader's depth. A view of another extent, or of a format that is not the plane's, takes the ordinary texture path, as `DepthSurfaceAt` already decides for sampled views; a view of another level still throws. A `D16_UNORM_S8_UINT` surface that the device stores as `D24_UNORM_S8_UINT` or `D32_SFLOAT_S8_UINT` holds 4 bytes per depth texel, so a storage view of its depth plane throws, naming both formats; its stencil plane is supported. This is the storage counterpart of the depth copy that comparison sampling takes since d024709cf. The refused binding is the stop reported in #1409 (PPSA10112); that title is not tested here. ### Tested - Ubuntu 24.04, Linux 7.0, GCC 13.3, Release, based on `1c5e62878`. `ctest`: 996 tests pass. - New `agc_driver_depth_storage` (RTX 5080) checks both copy directions for depth and stencil, the reuse of the storage image, the fall-through for another extent or format and the refusal of another level; `agc_driver_depth_storage_reuse` and `agc_driver_depth_compare_copy` still pass. - `agc_driver_graphics`: on a device without `D16_UNORM_S8_UINT`, a storage view of the depth plane of a D16 surface with stencil throws. - PPSA15304 (engine: Unreal Engine 5): copies depth and stencil of a 2848x1600 `D32_SFLOAT_S8_UINT` target through storage images every frame; the dispatch that stopped the title now runs, and together with #4586 and layered rendering into 3D color targets (the change #1077 proposes) the title reaches its main menu. - Windows not built or tested. ### 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 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: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
xXPBSXx commented 2026-10-12 14:51:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T14:51:12Z.


Windows build of head dfa876696 merged onto current main (d592d54e1, clean merge): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. The driver and agc_driver_graphics_tests, agc_driver_depth_storage_reuse_tests and agc_driver_depth_compare_copy_tests build, but the new test does not compile:

tests/execution/DepthStorage.cpp:239:55: error: 'aligned_alloc' is not a member of 'std'; did you mean 'aligned_union'?
  239 |         auto* block = static_cast<std::uint8_t*>(std::aligned_alloc(65536, BlockBytes));

std::aligned_alloc is not provided by the MinGW-w64 C runtime. The neighbouring tests avoid it (DepthStorageReuse.cpp uses alignas(4096) std::array for the guest memory); a 64 KiB alignas array or a platform switch to _aligned_malloc/_aligned_free would build on both systems. std::free at line 249 would have to follow, since memory from _aligned_malloc needs _aligned_free.

Not run: the GPU tests (agc_driver_depth_storage, agc_driver_depth_storage_reuse, agc_driver_depth_compare_copy) are waiting for the machine to be free; I will post their result here. Related: #425 also addresses #1409 (sampling and storage access to depth surfaces) and breaks agc_driver_depth_storage_reuse on main (https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6125624406); the two PRs overlap in DepthSurface.cpp and ShaderResources.cpp.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126680949 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6126680949). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T14:51:12Z. --- Windows build of head `dfa876696` merged onto current `main` (`d592d54e1`, clean merge): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. The driver and `agc_driver_graphics_tests`, `agc_driver_depth_storage_reuse_tests` and `agc_driver_depth_compare_copy_tests` build, but the new test does not compile: ``` tests/execution/DepthStorage.cpp:239:55: error: 'aligned_alloc' is not a member of 'std'; did you mean 'aligned_union'? 239 | auto* block = static_cast<std::uint8_t*>(std::aligned_alloc(65536, BlockBytes)); ``` `std::aligned_alloc` is not provided by the MinGW-w64 C runtime. The neighbouring tests avoid it (`DepthStorageReuse.cpp` uses `alignas(4096) std::array` for the guest memory); a 64 KiB `alignas` array or a platform switch to `_aligned_malloc`/`_aligned_free` would build on both systems. `std::free` at line 249 would have to follow, since memory from `_aligned_malloc` needs `_aligned_free`. Not run: the GPU tests (`agc_driver_depth_storage`, `agc_driver_depth_storage_reuse`, `agc_driver_depth_compare_copy`) are waiting for the machine to be free; I will post their result here. Related: #425 also addresses #1409 (sampling and storage access to depth surfaces) and breaks `agc_driver_depth_storage_reuse` on `main` (https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6125624406); the two PRs overlap in `DepthSurface.cpp` and `ShaderResources.cpp`. AI-assisted (Claude Code).
ThatsLeo commented 2026-10-12 15:34:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-12T15:34:16Z.


@ee6aba54 I ran the stencil test from my follow-up to #425 against this PR (dfa87669, merged with main). It passes on Intel Arc (Mesa 26.2.3 ANV) and lavapipe, and on plain main it fails with storage image access to depth/stencil surface ... is not implemented. The other depth tests (depth_storage, depth_storage_reuse, depth_compare_copy, depth_fast_clear*, depth_bias_per_face, stencil_ref_export) pass on both devices with this PR.

It checks the one path DepthStorage.cpp doesn't: a stencil plane written through a storage image, and seen by the next draw's stencil test. On a D32S8 surface:

  1. a draw writes depth 0.5 and stencil 1;
  2. two compute dispatches write the first 32 texels, R32 through the depth plane and R8 through the stencil plane;
  3. draws then check:
    • a stencil test passes exactly those 32 texels;
    • the other texels still hold 1;
    • a depth test sees the 32 texels written through the depth plane, alongside the stencil writer.

It's a single file, tests/execution/DepthStencilStorage.cpp (agc_driver_depth_stencil_storage), on ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage-v2. Take it into this PR if it's useful.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127448911 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6127448911). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-12T15:34:16Z. --- @ee6aba54 I ran the stencil test from my follow-up to #425 against this PR (`dfa87669`, merged with `main`). It passes on Intel Arc (Mesa 26.2.3 ANV) and lavapipe, and on plain `main` it fails with `storage image access to depth/stencil surface ... is not implemented`. The other depth tests (`depth_storage`, `depth_storage_reuse`, `depth_compare_copy`, `depth_fast_clear*`, `depth_bias_per_face`, `stencil_ref_export`) pass on both devices with this PR. It checks the one path `DepthStorage.cpp` doesn't: a stencil plane written through a storage image, and seen by the next draw's stencil test. On a D32S8 surface: 1. a draw writes depth 0.5 and stencil 1; 2. two compute dispatches write the first 32 texels, R32 through the depth plane and R8 through the stencil plane; 3. draws then check: - a stencil test passes exactly those 32 texels; - the other texels still hold 1; - a depth test sees the 32 texels written through the depth plane, alongside the stencil writer. It's a single file, `tests/execution/DepthStencilStorage.cpp` (`agc_driver_depth_stencil_storage`), on [`ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage-v2`](https://github.com/ThatsLeo/AnyPS5/blob/feat/agc-depth-stencil-storage-v2/core/libs/prx/libSceAgcDriver/tests/execution/DepthStencilStorage.cpp). Take it into this PR if it's useful. AI-assisted: yes.
MichonGoddijn231849 commented 2026-10-12 16:07:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-12T16:07:59Z.


For coordination: #425 had a storage path for depth surfaces too. I've taken it out, so storage access to depth surfaces is this PR's alone. #425 now only samples depth planes as 2D arrays, cubes and R16_UINT views (DepthPlaneCopy). The two still touch DepthSurface.cpp, but in different functions (DepthSurfaceTexture and its copy class there, the storage seed and take-back here). One point to check against this PR: #425's copy needs VK_IMAGE_USAGE_TRANSFER_SRC_BIT on the depth image as well.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128007834 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6128007834). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-12T16:07:59Z. --- For coordination: #425 had a storage path for depth surfaces too. I've taken it out, so storage access to depth surfaces is this PR's alone. #425 now only samples depth planes as 2D arrays, cubes and R16_UINT views (`DepthPlaneCopy`). The two still touch `DepthSurface.cpp`, but in different functions (`DepthSurfaceTexture` and its copy class there, the storage seed and take-back here). One point to check against this PR: #425's copy needs `VK_IMAGE_USAGE_TRANSFER_SRC_BIT` on the depth image as well.
ee6aba54 commented 2026-10-12 16:22:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-12T16:22:45Z.


Thanks for the reviews. Updated to 0d32f7e00, rebased onto 2a5eca11c:

  • @xXPBSXx: the test's guest block is now a statically allocated buffer aligned to 64 KiB by hand, so std::aligned_alloc and std::free are gone.
  • @MichonGoddijn231849: right, the copy into the staging buffer reads the depth image, so the image is now created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT.
  • @ThatsLeo: thanks for the stencil test; it covers a path DepthStorage.cpp does not. I would rather not take another author's file into this PR; it fits well as a follow-up of yours once this merges.

ctest: 960 tests pass on Linux (RTX 5080).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128255403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6128255403). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-12T16:22:45Z. --- Thanks for the reviews. Updated to `0d32f7e00`, rebased onto `2a5eca11c`: - @xXPBSXx: the test's guest block is now a statically allocated buffer aligned to 64 KiB by hand, so `std::aligned_alloc` and `std::free` are gone. - @MichonGoddijn231849: right, the copy into the staging buffer reads the depth image, so the image is now created with `VK_IMAGE_USAGE_TRANSFER_SRC_BIT`. - @ThatsLeo: thanks for the stencil test; it covers a path `DepthStorage.cpp` does not. I would rather not take another author's file into this PR; it fits well as a follow-up of yours once this merges. `ctest`: 960 tests pass on Linux (RTX 5080).
ee6aba54 commented 2026-10-12 22:34:20 +00:00 (Migrated from github.com)

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


Updated to cdfba5144, rebased onto 5efd09afc:

  • main now stores D16_UNORM_S8_UINT as D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT on devices without it. Copying the depth aspect of such a surface yields 4 bytes per texel, so a storage view of its depth plane now throws, naming both formats; the stencil plane is unaffected. agc_driver_graphics checks the refusal on a device without the 16-bit format.
  • Overlap: #2076 (@jdmagic) adds storage views over the stencil plane on top of #425's former depth-plane path. I have described on #2076 which parts are in both and which are only there.

ctest: 993 tests pass on Linux (RTX 5080).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6133900315 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6133900315). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-12T22:34:20Z. --- Updated to `cdfba5144`, rebased onto `5efd09afc`: - `main` now stores `D16_UNORM_S8_UINT` as `D24_UNORM_S8_UINT` or `D32_SFLOAT_S8_UINT` on devices without it. Copying the depth aspect of such a surface yields 4 bytes per texel, so a storage view of its depth plane now throws, naming both formats; the stencil plane is unaffected. `agc_driver_graphics` checks the refusal on a device without the 16-bit format. - Overlap: #2076 (@jdmagic) adds storage views over the stencil plane on top of #425's former depth-plane path. I have described on #2076 which parts are in both and which are only there. `ctest`: 993 tests pass on Linux (RTX 5080).
oneandonlydean commented 2026-10-12 22:41:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T22:41:15Z.


Data point from a title we test with, on main 682ef0c1 with the head before cdfba5144: on main it stops before its title screen at storage image access to depth/stencil surface 0x53a500000 is not implemented (storage=960x540 guest format=22 mip=0 dimension=1 tile=4), compute shader 0x50073d500. With this PR it gets past that and stops at the depth plane sampling refusal that #425 covers. With both, 330 s with no stop, error line or device loss.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134004598 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6134004598). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T22:41:15Z. --- Data point from a title we test with, on `main` 682ef0c1 with the head before cdfba5144: on `main` it stops before its title screen at `storage image access to depth/stencil surface 0x53a500000 is not implemented (storage=960x540 guest format=22 mip=0 dimension=1 tile=4)`, compute shader `0x50073d500`. With this PR it gets past that and stops at the depth plane sampling refusal that #425 covers. With both, 330 s with no stop, error line or device loss.
ee6aba54 commented 2026-10-13 00:33:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-13T00:33:22Z.


Rebased onto 1c5e62878 (#425 merged): ac2ffc48f. The conflicts were adjacent additions in DepthSurface.cpp (the DepthPlaneCopy class next to Storage and StoreBack) and in DepthSurfaceReuse.cpp (both D16 checks are kept). No change to the code of this PR. ctest: 996 tests pass. @jdmagic #2076 needs the new head as its base.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135332433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6135332433). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-13T00:33:22Z. --- Rebased onto `1c5e62878` (#425 merged): `ac2ffc48f`. The conflicts were adjacent additions in `DepthSurface.cpp` (the `DepthPlaneCopy` class next to `Storage` and `StoreBack`) and in `DepthSurfaceReuse.cpp` (both D16 checks are kept). No change to the code of this PR. `ctest`: 996 tests pass. @jdmagic #2076 needs the new head as its base.
winstrex commented 2026-10-13 00:41:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by winstrex on 2026-10-13T00:41:31Z.


Windows data point: Windows 11, WinLibs GCC 15.2.0, Release, RTX 5070 Ti. This PR as is (cdfba5144), plus #4491 and a local CMASK fix to get that far.

The Pathless (PPSA01825) reaches a compute dispatch that writes the stencil plane of a 256x256 D32_SFLOAT_S8_UINT depth target: one IMAGE_STORE (dmask 0x1) through a one-layer 2D-array R8_UINT view, tile kZ64KBX, HTILE without stencil. On main it stops there with storage image access to depth/stencil surface ... is not implemented (storage=256x256 guest format=5 mip=0 dimension=2 tile=4). With this PR it gets past it in 4 of 5 runs and next stops at color views of several array slices are unsupported (#2102). The fifth run ended earlier in an intermittent segfault in the title's own code that also happens without this PR.

Update: with head ac2ffc48f and #3763 (53dae55dc), both on main 758aca737, LEGO Horizon Adventures (PPSA14632) gets past its 2112x1188 depth-plane storage stop (#1409) in 5 of 5 runs and plays its intro; one run faulted in the title, as it also does with #3763 alone.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135443503 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6135443503). Originally posted by [winstrex](https://github.com/winstrex) on 2026-10-13T00:41:31Z. --- Windows data point: Windows 11, WinLibs GCC 15.2.0, Release, RTX 5070 Ti. This PR as is (`cdfba5144`), plus #4491 and a local CMASK fix to get that far. The Pathless (PPSA01825) reaches a compute dispatch that writes the stencil plane of a 256x256 `D32_SFLOAT_S8_UINT` depth target: one `IMAGE_STORE` (dmask 0x1) through a one-layer 2D-array `R8_UINT` view, tile `kZ64KBX`, HTILE without stencil. On `main` it stops there with `storage image access to depth/stencil surface ... is not implemented (storage=256x256 guest format=5 mip=0 dimension=2 tile=4)`. With this PR it gets past it in 4 of 5 runs and next stops at `color views of several array slices are unsupported` (#2102). The fifth run ended earlier in an intermittent segfault in the title's own code that also happens without this PR. Update: with head `ac2ffc48f` and #3763 (`53dae55dc`), both on `main` `758aca737`, LEGO Horizon Adventures (PPSA14632) gets past its 2112x1188 depth-plane storage stop (#1409) in 5 of 5 runs and plays its intro; one run faulted in the title, as it also does with #3763 alone.
fma-rc commented 2026-10-13 00:57:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T00:57:03Z.


Astro's Playroom (PPSA01325) data point for head ac2ffc48f, Linux, RTX 5080.

On main 1c5e62878 it enters its first level, renders 34 frames in 80 s and then stops with compute shader 0x50028e000: AGC graphics: storage image access to depth/stencil surface 0x54d420000 is not implemented (storage=1920x1080 guest format=22 mip=0 dimension=1 tile=4).

With this PR merged onto main 284a1c334 the stop is gone in four of four runs of about four minutes each (all with a local frame-capture patch, two also with an unrelated local driver change), and the frame I captured in the level's opening scene renders correctly. It is slow there: 0.4 to 0.8 fps, Graphics::Draw at 300 to 520 us per draw packet under APS5_PROFILE_DRAW=1. I have not looked at where that time goes, so I can't say whether this PR has a part in it.

agc_driver_depth_storage and agc_driver_depth_storage_reuse pass on RTX 5080, Radeon 610M (RADV) and lavapipe, on main 4430780bd plus this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135708894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6135708894). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-13T00:57:03Z. --- Astro's Playroom (PPSA01325) data point for head `ac2ffc48f`, Linux, RTX 5080. On `main` 1c5e62878 it enters its first level, renders 34 frames in 80 s and then stops with `compute shader 0x50028e000: AGC graphics: storage image access to depth/stencil surface 0x54d420000 is not implemented (storage=1920x1080 guest format=22 mip=0 dimension=1 tile=4)`. With this PR merged onto `main` 284a1c334 the stop is gone in four of four runs of about four minutes each (all with a local frame-capture patch, two also with an unrelated local driver change), and the frame I captured in the level's opening scene renders correctly. It is slow there: 0.4 to 0.8 fps, `Graphics::Draw` at 300 to 520 us per draw packet under `APS5_PROFILE_DRAW=1`. I have not looked at where that time goes, so I can't say whether this PR has a part in it. `agc_driver_depth_storage` and `agc_driver_depth_storage_reuse` pass on RTX 5080, Radeon 610M (RADV) and lavapipe, on `main` 4430780bd plus this head.
oneandonlydean commented 2026-10-13 01:38:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T01:38:02Z.


Pushed two commits on top of your rebase (848b97b611), fast-forward, yours untouched:

  • 26dfc464a7: three cases the plane copy cannot serve now throw instead of going through. A storage view that is not 2D throws main's storage image access to depth/stencil surface ... is not implemented, as before this PR; a store to a multisampled depth surface throws; and StoreBack through a view that another view of the same plane replaced throws, since its writes would be dropped. The debt entry lists them.
  • 848b97b611: agc_driver_depth_storage_dispatch, which goes through dispatches: depth and stencil stores read back by depth- and stencil-tested draws and in guest memory after the flush, plus the three refusals. agc_driver_depth_storage alone still passed with the two DepthSurfaceStoreBack calls removed.

Linux, RTX 4090: ctest -R "agc|shader" 463/463, validation layer clean on the depth tests, and the new test passes on llvmpipe. Not built on Windows.

The 2D-array case is the one The Pathless (PPSA01825) hits in the Windows report above, so it stops there again until one-layer array views are handled; that is a separate change.

This will conflict with #2491 in DepthSurface.cpp once that is merged. I'll rebase it then; StoreBack also has to bump the write serial there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136189171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6136189171). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T01:38:02Z. --- Pushed two commits on top of your rebase (848b97b611), fast-forward, yours untouched: - `26dfc464a7`: three cases the plane copy cannot serve now throw instead of going through. A storage view that is not 2D throws main's `storage image access to depth/stencil surface ... is not implemented`, as before this PR; a store to a multisampled depth surface throws; and `StoreBack` through a view that another view of the same plane replaced throws, since its writes would be dropped. The debt entry lists them. - `848b97b611`: `agc_driver_depth_storage_dispatch`, which goes through dispatches: depth and stencil stores read back by depth- and stencil-tested draws and in guest memory after the flush, plus the three refusals. `agc_driver_depth_storage` alone still passed with the two `DepthSurfaceStoreBack` calls removed. Linux, RTX 4090: `ctest -R "agc|shader"` 463/463, validation layer clean on the depth tests, and the new test passes on llvmpipe. Not built on Windows. The 2D-array case is the one The Pathless (PPSA01825) hits in the Windows report above, so it stops there again until one-layer array views are handled; that is a separate change. This will conflict with #2491 in `DepthSurface.cpp` once that is merged. I'll rebase it then; `StoreBack` also has to bump the write serial there.
github-actions[bot] commented 2026-10-13 02:39:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T02:39:03Z.


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-30
#4868 docs/dev/debt/libSceAgcDriver.md L28-30
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136994006 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4500#issuecomment-6136994006). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T02:39:03Z. --- <!-- 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-30](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/libSceAgcDriver.md#L28-L30) | | | | #4868 | `docs/dev/debt/libSceAgcDriver.md` [L28-30](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/libSceAgcDriver.md#L28-L30) | | |
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!4500
No description provided.