feat(agc): depth planes sampled as 2D arrays, cubes and integer views #425

Merged
MichonGoddijn231849 merged 3 commits from upstream-pr/425 into main 2026-10-12 23:58:34 +00:00
MichonGoddijn231849 commented 2026-10-02 23:57:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-02T23:57:13Z.


What

Depth surfaces could only be sampled as one 2D slice of their own format. 2D arrays, cubes and the R16_UINT integer view of a D16 plane were refused with sampling the depth plane of depth surface ... is not implemented.

They now work:

  • A one-slice 2D array views the depth image as an array.
  • Several slices, a cube (6 faces) or an integer view of a D16 plane are copied into a per-use image of consecutive slices (DepthPlaneCopy):
    • a slice a depth surface holds comes from that surface's depth plane, after its pending fast clear;
    • any other slice comes from guest memory, detiled (DepthSliceBytes apart).
  • A depth-bits R16_UINT view (an R16_UINT T# with a depth swizzle) keeps the depth copy, because the shader converts the sampled depth to its bits itself. GTA V's compute 0x242d4a200 samples a D16 plane array that way (reported by @tibzejoker).
  • Such a texture is re-copied at every use, so it never serves a draw template or the stage-A fast path.
  • Depth surfaces can now be transfer sources.

Storage-image access to depth surfaces was part of this PR at first. #4500 implements it, with stencil planes and the reused-memory fall-through, so it is no longer in this PR.

Part of #1409 (the sampled views; #4500 covers its storage half).

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), MinGW-w64 GCC 15.2.0, on main 82b1b2e7a.

  • New agc_driver_depth_plane_sampling loads row 0 through each view and pins the values:

    • a 3-slice D32 2D array (slice 0 from a drawn surface, slices 1 and 2 from guest memory);
    • a D32 cube, all six faces;
    • a D16 plane as R16_UINT;
    • a D16 depth-bits R16_UINT array, both slices' raw values;
    • a plane array from base slice 1, still refused.

    It fails on main (the array is refused) and without the depth-bits format gate (with GTA V's message).

  • agc_driver_graphics, depth_compare_copy, depth_storage_reuse, depth_fast_clear(_submit), depth_bias_per_face, pending_exact_surface, prepared_graphics and check_conventions.py pass.

  • GTA V (PPSA04264): earlier heads of this PR (with the storage half) took the Prologue past its first depth-plane read. I have not rerun the title on this head.

Checklist

  • Based on current main; no other open PR implements the same functions (#4500 is the storage half)
  • 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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4722699619 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-02T23:57:13Z. --- ### What Depth surfaces could only be sampled as one 2D slice of their own format. 2D arrays, cubes and the R16_UINT integer view of a D16 plane were refused with `sampling the depth plane of depth surface ... is not implemented`. They now work: - A one-slice 2D array views the depth image as an array. - Several slices, a cube (6 faces) or an integer view of a D16 plane are copied into a per-use image of consecutive slices (`DepthPlaneCopy`): - a slice a depth surface holds comes from that surface's depth plane, after its pending fast clear; - any other slice comes from guest memory, detiled (`DepthSliceBytes` apart). - A depth-bits R16_UINT view (an R16_UINT T# with a depth swizzle) keeps the depth copy, because the shader converts the sampled depth to its bits itself. GTA V's compute `0x242d4a200` samples a D16 plane array that way (reported by @tibzejoker). - Such a texture is re-copied at every use, so it never serves a draw template or the stage-A fast path. - Depth surfaces can now be transfer sources. Storage-image access to depth surfaces was part of this PR at first. #4500 implements it, with stencil planes and the reused-memory fall-through, so it is no longer in this PR. Part of #1409 (the sampled views; #4500 covers its storage half). ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), MinGW-w64 GCC 15.2.0, on `main` `82b1b2e7a`. - New `agc_driver_depth_plane_sampling` loads row 0 through each view and pins the values: - a 3-slice D32 2D array (slice 0 from a drawn surface, slices 1 and 2 from guest memory); - a D32 cube, all six faces; - a D16 plane as R16_UINT; - a D16 depth-bits R16_UINT array, both slices' raw values; - a plane array from base slice 1, still refused. It fails on `main` (the array is refused) and without the depth-bits format gate (with GTA V's message). - `agc_driver_graphics`, `depth_compare_copy`, `depth_storage_reuse`, `depth_fast_clear(_submit)`, `depth_bias_per_face`, `pending_exact_surface`, `prepared_graphics` and `check_conventions.py` pass. - GTA V (PPSA04264): earlier heads of this PR (with the storage half) took the Prologue past its first depth-plane read. I have not rerun the title on this head. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#4500 is the storage half) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [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. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ThisIsAkill commented 2026-10-04 03:35:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T03:35:31Z.


A case from PPSA21567 (Astro Bot) for this PR's depth storage-image path, in case it helps. Linux, on #426 with main and other local changes, so not clean main. The facts come from a local-only trace; nothing below is a decision.

What the title does with one allocation (base 0x53a500000, 960x540, 4 bytes per texel). T# and DB fields are decoded with Mesa's gfx10-rsrc.json / gfx10.json; swizzle names are from addrlib addrtypes.h.

Use Format Swizzle Metadata
Depth target (DB_Z_INFO 0x80000183, DB_DEPTH_VIEW 0) Z_32_FLOAT 24 SW_64KB_Z_X TILE_SURFACE_ENABLE 0, DB_HTILE_DATA_BASE 0, so no HTILE
Compute storage and texture views R32_FLOAT (guest format 22) 24 SW_64KB_Z_X none
Compute storage and texture views B10G11R11 (guest format 36) 27 SW_64KB_R_X DCC: COMPRESSION_EN 1, WRITE_COMPRESS_ENABLE 1, metadata at about 0x5708e4000

Every view has the same base, extent, slice 0 and mip 0. The colour view uses the render-target swizzle and DCC; the depth target and the R32F views use the depth swizzle.

Order of uses, every frame once the scene starts:

  1. A compute shader writes the memory as R32F storage, and several compute shaders read it as R32F.
  2. About 50 draws bind it as the D32 depth target.
  3. Two compute shaders then bind the B10G11R11 view as both a sampled image and a storage image. Both read it before writing it (image_sample_lz / image_load, then image_store). In one of them the two T# registers hold the same B10G11R11 descriptor, so it updates the view in place.

In earlier frames (before the depth pass appears) the memory is only ever used through the R32F and B10G11R11 views.

On this branch, step 3 throws storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122, then sampling the depth plane ... as a texture of guest format 36. Both are refused because the views are routed into the depth path by base address.

What I could not observe: whether the B10G11R11 read in step 3 depends on the bytes the depth pass left. That depends on the view's DCC keys. The trace sees them as 0000 at the first bind and uncompressed at every bind and depth bind after that, with no fills over them. But the driver itself marks keys uncompressed after its write-backs (MarkDccUncompressed), so inside the emulator "uncompressed" doesn't show what the hardware keys would be.

A suggestion, for you to judge:

  1. Match a view to a depth surface by layout, not only by base address. Only a depth (Z) swizzle with the depth format's element size and no colour metadata is a view of the depth surface. The R32F views here qualify; the B10G11R11 views would take the ordinary colour and storage path over guest memory instead of throwing.
  2. When a view with a different layout touches the allocation, write the depth image back to guest memory in its own layout and mark the surface stale. Guest memory is then the source of truth, so the colour path reads the same bytes the hardware would, whatever the shader means by them.
  3. On the next depth bind of a stale surface, reseed the depth image from guest memory. Here the R32F compute pass rewrites the surface before the depth draws anyway.

That reproduces the hardware without guessing the title's intent, as long as the colour path itself is exact. The one remaining gap is the DCC keys being rewritten as uncompressed after write-backs. I'm trying this locally and can report how it behaves, if that's useful.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5976206045 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5976206045). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T03:35:31Z. --- A case from PPSA21567 (Astro Bot) for this PR's depth storage-image path, in case it helps. Linux, on #426 with `main` and other local changes, so not clean `main`. The facts come from a local-only trace; nothing below is a decision. **What the title does with one allocation** (base `0x53a500000`, 960x540, 4 bytes per texel). T# and DB fields are decoded with Mesa's `gfx10-rsrc.json` / `gfx10.json`; swizzle names are from addrlib `addrtypes.h`. | Use | Format | Swizzle | Metadata | |---|---|---|---| | Depth target (`DB_Z_INFO 0x80000183`, `DB_DEPTH_VIEW 0`) | Z_32_FLOAT | 24 `SW_64KB_Z_X` | `TILE_SURFACE_ENABLE` 0, `DB_HTILE_DATA_BASE` 0, so no HTILE | | Compute storage and texture views | R32_FLOAT (guest format 22) | 24 `SW_64KB_Z_X` | none | | Compute storage and texture views | B10G11R11 (guest format 36) | 27 `SW_64KB_R_X` | DCC: `COMPRESSION_EN` 1, `WRITE_COMPRESS_ENABLE` 1, metadata at about `0x5708e4000` | Every view has the same base, extent, slice 0 and mip 0. The colour view uses the render-target swizzle and DCC; the depth target and the R32F views use the depth swizzle. **Order of uses, every frame once the scene starts:** 1. A compute shader writes the memory as R32F storage, and several compute shaders read it as R32F. 2. About 50 draws bind it as the D32 depth target. 3. Two compute shaders then bind the B10G11R11 view as both a sampled image and a storage image. Both read it before writing it (`image_sample_lz` / `image_load`, then `image_store`). In one of them the two T# registers hold the same B10G11R11 descriptor, so it updates the view in place. In earlier frames (before the depth pass appears) the memory is only ever used through the R32F and B10G11R11 views. On this branch, step 3 throws `storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122`, then `sampling the depth plane ... as a texture of guest format 36`. Both are refused because the views are routed into the depth path by base address. **What I could not observe:** whether the B10G11R11 read in step 3 depends on the bytes the depth pass left. That depends on the view's DCC keys. The trace sees them as `0000` at the first bind and `uncompressed` at every bind and depth bind after that, with no fills over them. But the driver itself marks keys uncompressed after its write-backs (`MarkDccUncompressed`), so inside the emulator "uncompressed" doesn't show what the hardware keys would be. **A suggestion, for you to judge:** 1. Match a view to a depth surface by layout, not only by base address. Only a depth (Z) swizzle with the depth format's element size and no colour metadata is a view of the depth surface. The R32F views here qualify; the B10G11R11 views would take the ordinary colour and storage path over guest memory instead of throwing. 2. When a view with a different layout touches the allocation, write the depth image back to guest memory in its own layout and mark the surface stale. Guest memory is then the source of truth, so the colour path reads the same bytes the hardware would, whatever the shader means by them. 3. On the next depth bind of a stale surface, reseed the depth image from guest memory. Here the R32F compute pass rewrites the surface before the depth draws anyway. That reproduces the hardware without guessing the title's intent, as long as the colour path itself is exact. The one remaining gap is the DCC keys being rewritten as uncompressed after write-backs. I'm trying this locally and can report how it behaves, if that's useful.
oneandonlydean commented 2026-10-04 07:10:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T07:10:21Z.


@boykopovar this one needs your call on where depth bits live when something other than the depth path reads them. This PR copies the slices a host depth surface holds from its depth image and reads every other slice from guest memory. On main, depth surfaces never write back to guest memory (DepthSurface.cpp only creates and clears the image), so a slice that a host depth surface wrote but no longer holds reads stale bytes without an error.

ThisIsAkill described the other model in https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5976206045: write the depth image back to guest memory when a view with another layout touches it, mark the surface stale, and reseed it at the next depth bind. That changes how depth surfaces work for every title, so it's your decision. My read: the write-back model is the exact one, and this PR's reads are exact only while no host depth surface wrote those slices. It also has no unit test yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5977588142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5977588142). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T07:10:21Z. --- @boykopovar this one needs your call on where depth bits live when something other than the depth path reads them. This PR copies the slices a host depth surface holds from its depth image and reads every other slice from guest memory. On main, depth surfaces never write back to guest memory (`DepthSurface.cpp` only creates and clears the image), so a slice that a host depth surface wrote but no longer holds reads stale bytes without an error. ThisIsAkill described the other model in https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5976206045: write the depth image back to guest memory when a view with another layout touches it, mark the surface stale, and reseed it at the next depth bind. That changes how depth surfaces work for every title, so it's your decision. My read: the write-back model is the exact one, and this PR's reads are exact only while no host depth surface wrote those slices. It also has no unit test yet.
MichonGoddijn231849 commented 2026-10-04 08:13:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:13:40Z.


@ThisIsAkill, thanks, that trace is very useful. You're both right about the gap. This PR copies the slices a host depth surface still holds and reads the rest from guest memory. Because depth surfaces never write back on main, a slice the surface wrote but no longer holds reads stale bytes.

My proposal, for @boykopovar to decide:

  1. In this PR: match a view to a depth surface by layout, not only by base address. Only a depth (Z) swizzle with the depth format's element size and no colour metadata counts as a view of the depth plane. Other views (the B10G11R11 render-target swizzle with DCC in Astro Bot) take the ordinary colour and storage path instead of throwing. I'll add the unit test Dean asked for.
  2. Separately, because it changes every title: the write-back model ThisIsAkill describes. The depth image is written back to guest memory when a view with another layout touches it, the surface is marked stale, and it is reseeded from guest memory at the next depth bind. That is the exact model, and multisampled targets (#419) need the same machinery, so I'd do both in one follow-up.

If you'd rather go straight to write-back, I'll fold it into this PR instead.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978008518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5978008518). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-04T08:13:40Z. --- @ThisIsAkill, thanks, that trace is very useful. You're both right about the gap. This PR copies the slices a host depth surface still holds and reads the rest from guest memory. Because depth surfaces never write back on `main`, a slice the surface wrote but no longer holds reads stale bytes. My proposal, for @boykopovar to decide: 1. In this PR: match a view to a depth surface by layout, not only by base address. Only a depth (Z) swizzle with the depth format's element size and no colour metadata counts as a view of the depth plane. Other views (the B10G11R11 render-target swizzle with DCC in Astro Bot) take the ordinary colour and storage path instead of throwing. I'll add the unit test Dean asked for. 2. Separately, because it changes every title: the write-back model ThisIsAkill describes. The depth image is written back to guest memory when a view with another layout touches it, the surface is marked stale, and it is reseeded from guest memory at the next depth bind. That is the exact model, and multisampled targets (#419) need the same machinery, so I'd do both in one follow-up. If you'd rather go straight to write-back, I'll fold it into this PR instead.
MichonGoddijn231849 commented 2026-10-04 09:16:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T09:16:58Z.


Restacked on the updated #374 (per-aspect HTILE clears) and #294; both still ship inside this PR until they merge. The fast-clear merge keeps this PR's reset of the storage link (writer, seeded) on a clear, now only when an aspect is actually cleared. Build and ctest are clean apart from the failures main has locally. The layout-matching change I proposed above waits for @boykopovar's call.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978441976 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5978441976). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-04T09:16:58Z. --- Restacked on the updated #374 (per-aspect HTILE clears) and #294; both still ship inside this PR until they merge. The fast-clear merge keeps this PR's reset of the storage link (`writer`, `seeded`) on a clear, now only when an aspect is actually cleared. Build and ctest are clean apart from the failures `main` has locally. The layout-matching change I proposed above waits for @boykopovar's call.
oneandonlydean commented 2026-10-04 09:52:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:52:15Z.


Thanks for the restack. Step 1 sounds right to me as long as one case keeps throwing. In ThisIsAkill's trace the B10G11R11 view comes right after about 50 depth draws into the same memory. Without the write-back, the ordinary colour path would read guest memory the depth image never wrote, so today's refusal would turn into a silent stale read. Could step 1 still refuse a view with another layout while a host depth surface at that address holds depth newer than guest memory, and route only views that alias no live depth surface? The write-back model itself is still @boykopovar's call.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978693553 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5978693553). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T09:52:15Z. --- Thanks for the restack. Step 1 sounds right to me as long as one case keeps throwing. In ThisIsAkill's trace the B10G11R11 view comes right after about 50 depth draws into the same memory. Without the write-back, the ordinary colour path would read guest memory the depth image never wrote, so today's refusal would turn into a silent stale read. Could step 1 still refuse a view with another layout while a host depth surface at that address holds depth newer than guest memory, and route only views that alias no live depth surface? The write-back model itself is still @boykopovar's call.
MichonGoddijn231849 commented 2026-10-05 15:40:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-05T15:40:56Z.


Agreed, that's the right line: a view with another layout should only take the colour path when no live host depth surface at that address holds depth newer than guest memory, and keep throwing otherwise.

One thing to coordinate: #454 (@SP4C3B4R-8) changes the same routing in DepthSurface::Sampled. A texture whose format doesn't match the depth view returns nullptr there and reads guest memory. That's my step 1, but without the check you describe, so it would read stale bytes after ThisIsAkill's ~50 depth draws. I'd rather not have two PRs change that path. I suggest the routing plus your live-surface refusal goes into #454, and this PR stays with arrays, cubes, the R16_UINT view and storage access. If you or @SP4C3B4R-8 would rather I add it here instead, I will.

Rebased onto current main (and today's rebase of #374). The conflict was in cachedStorageTexture, where main renamed the resource to viewed for views past the last mip (#490). The depth seeding now sits on top of main's lookup, and main's own depth-surface refusal there is replaced by it as before. Build and ctest are clean apart from the failures main has locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5997831307 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-5997831307). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-05T15:40:56Z. --- Agreed, that's the right line: a view with another layout should only take the colour path when no live host depth surface at that address holds depth newer than guest memory, and keep throwing otherwise. One thing to coordinate: #454 (@SP4C3B4R-8) changes the same routing in `DepthSurface::Sampled`. A texture whose format doesn't match the depth view returns `nullptr` there and reads guest memory. That's my step 1, but without the check you describe, so it would read stale bytes after ThisIsAkill's ~50 depth draws. I'd rather not have two PRs change that path. I suggest the routing plus your live-surface refusal goes into #454, and this PR stays with arrays, cubes, the R16_UINT view and storage access. If you or @SP4C3B4R-8 would rather I add it here instead, I will. Rebased onto current `main` (and today's rebase of #374). The conflict was in `cachedStorageTexture`, where `main` renamed the resource to `viewed` for views past the last mip (#490). The depth seeding now sits on top of `main`'s lookup, and `main`'s own depth-surface refusal there is replaced by it as before. Build and ctest are clean apart from the failures `main` has locally.
oneandonlydean commented 2026-10-06 05:34:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T05:34:19Z.


That split sounds right to me. #454's author already plans the same rule: retire the depth surface when a colour target, a storage write or a CPU write covers its range, and keep the throw while it's still the latest writer. So moving the other-layout routing there, together with that refusal, keeps one PR on that path. They mentioned being away until 7 October and planned to build on this branch.

So this PR would stay with arrays, cubes, the R16_UINT view and storage access, and none of those reroute other-layout views. The write-back model is a separate question, and it's still with the maintainer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6010065736 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6010065736). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T05:34:19Z. --- That split sounds right to me. #454's author already plans the same rule: retire the depth surface when a colour target, a storage write or a CPU write covers its range, and keep the throw while it's still the latest writer. So moving the other-layout routing there, together with that refusal, keeps one PR on that path. They mentioned being away until 7 October and planned to build on this branch. So this PR would stay with arrays, cubes, the R16_UINT view and storage access, and none of those reroute other-layout views. The write-back model is a separate question, and it's still with the maintainer.
MichonGoddijn231849 commented 2026-10-06 15:47:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-06T15:47:59Z.


Thanks, then that's the split. This PR stays with arrays, cubes, the R16_UINT view and storage access. It never reroutes views with another layout: those still throw here, and the routing with the live-surface refusal goes into #454. I'll keep this branch stable for @SP4C3B4R-8 to build on.

Restacked on today's rebase of #374 so the commits it carries match #374's head (now b0414a9f), with no other changes. Builds; the driver tests pass apart from agc_driver_scalar_sop1, which fails without this PR too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6019994171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6019994171). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-06T15:47:59Z. --- Thanks, then that's the split. This PR stays with arrays, cubes, the R16_UINT view and storage access. It never reroutes views with another layout: those still throw here, and the routing with the live-surface refusal goes into #454. I'll keep this branch stable for @SP4C3B4R-8 to build on. Restacked on today's rebase of #374 so the commits it carries match #374's head (now b0414a9f), with no other changes. Builds; the driver tests pass apart from `agc_driver_scalar_sop1`, which fails without this PR too.
Celegans12 commented 2026-10-06 17:49:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-06T17:49:56Z.


Ghost of Yōtei (PPSA26344) writes the stencil plane through this storage path, and on this branch that would stop throwing without being handled, so here's the case.

Its deferred-decal compute shader (0x800027c200) does a per-texel read-modify-write of its 3840x2160 D32S8 target's stencil: it loads the value, ORs in 0x04 and stores it back through an 8_UINT T# at the DB stencil base (0x5004850000, same swizzle as the DB). DB_STENCIL_INFO has TILE_STENCIL_DISABLE = 1, so there's no HTILE stencil and the T# is exactly the plane the DB tests. On main the store throws in cachedStorageTexture (5 skipped dispatches per run for us).

On b0414a9f, DepthSurfaceAt matches the stencil address, but SeedStorageFromDepth only looks for target.address and Transfer copies only the depth aspect. So the store lands in an R8 image over guest memory with no seed and no take-back, while the shader's stencil loads still read the D32S8 image through DepthSurface::Sampled. Bit 0x04 never reaches the depth surface, and nothing reports it. Vulkan has no storage view of the plane either: neither NVIDIA 610.62 nor lavapipe exposes STORAGE_IMAGE on D32_SFLOAT_S8_UINT or S8_UINT, and RADV refuses stencil formats.

Things I noticed while reading, in case they help under whichever model gets picked:

  • there's one writer/seeded/writerLayer slot per surface, so a dispatch storing to both planes would need state per aspect;
  • SeedStorageFromDepth calls TakeWrites but not ApplyFastClear before seeding, which matters for Z too;
  • a stencil kept in HTILE (htileStencil) would still have to throw; Yōtei doesn't hit that.

A test that fails on both main and this branch: clear a D32S8 surface to stencil 0x11, look up R8_UINT storage at stencilAddress and expect 0x11, write 0x15, bind it as depth again and expect 0x15 in the stencil aspect. I can send the request file and register dump, or run Yōtei on this branch once the stencil plane is in.

Details
  • DB_Z_INFO 0xa0000183 (Z_32_FLOAT, SW 24, HTILE at 0x50050c0000), DB_STENCIL_INFO 0x20000181 (STENCIL_8, SW 24). Stencil base 0x5004850000 = Z base 0x5002870000 + DepthSliceBytes(3840x2160, 4).
  • Stencil T# (SRT+0xc0): 50048500 c0500000 021bc3bf 91800924 0 00700000 0 0.
  • 0x800027c200: image_load glc pc 0xa8 and 0x400c, v_or_b32 at 0x3ce4 (bit 0x04) and 0x4018, image_store glc pc 0x401c, at each invocation's own pixel.
  • b0414a9f: DepthSurface.cpp:116-118 (writer slot), :141 (depth aspect in Transfer), :451 (SeedStorageFromDepth), :494 (DepthSurfaceAt); ShaderResources.cpp:562.
  • Mesa: ac_descriptors.c:570-571 (stencil T# at stencil_offset), radv_formats.c:118-119.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6022128811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6022128811). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-06T17:49:56Z. --- Ghost of Yōtei (PPSA26344) writes the stencil plane through this storage path, and on this branch that would stop throwing without being handled, so here's the case. Its deferred-decal compute shader (0x800027c200) does a per-texel read-modify-write of its 3840x2160 D32S8 target's stencil: it loads the value, ORs in 0x04 and stores it back through an 8_UINT T# at the DB stencil base (0x5004850000, same swizzle as the DB). `DB_STENCIL_INFO` has `TILE_STENCIL_DISABLE` = 1, so there's no HTILE stencil and the T# is exactly the plane the DB tests. On `main` the store throws in `cachedStorageTexture` (5 skipped dispatches per run for us). On b0414a9f, `DepthSurfaceAt` matches the stencil address, but `SeedStorageFromDepth` only looks for `target.address` and `Transfer` copies only the depth aspect. So the store lands in an R8 image over guest memory with no seed and no take-back, while the shader's stencil loads still read the D32S8 image through `DepthSurface::Sampled`. Bit 0x04 never reaches the depth surface, and nothing reports it. Vulkan has no storage view of the plane either: neither NVIDIA 610.62 nor lavapipe exposes STORAGE_IMAGE on D32_SFLOAT_S8_UINT or S8_UINT, and RADV refuses stencil formats. Things I noticed while reading, in case they help under whichever model gets picked: - there's one `writer`/`seeded`/`writerLayer` slot per surface, so a dispatch storing to both planes would need state per aspect; - `SeedStorageFromDepth` calls `TakeWrites` but not `ApplyFastClear` before seeding, which matters for Z too; - a stencil kept in HTILE (`htileStencil`) would still have to throw; Yōtei doesn't hit that. A test that fails on both `main` and this branch: clear a D32S8 surface to stencil 0x11, look up R8_UINT storage at `stencilAddress` and expect 0x11, write 0x15, bind it as depth again and expect 0x15 in the stencil aspect. I can send the request file and register dump, or run Yōtei on this branch once the stencil plane is in. <details><summary>Details</summary> - `DB_Z_INFO` 0xa0000183 (Z_32_FLOAT, SW 24, HTILE at 0x50050c0000), `DB_STENCIL_INFO` 0x20000181 (STENCIL_8, SW 24). Stencil base 0x5004850000 = Z base 0x5002870000 + `DepthSliceBytes(3840x2160, 4)`. - Stencil T# (SRT+0xc0): `50048500 c0500000 021bc3bf 91800924 0 00700000 0 0`. - 0x800027c200: `image_load` glc pc 0xa8 and 0x400c, `v_or_b32` at 0x3ce4 (bit 0x04) and 0x4018, `image_store` glc pc 0x401c, at each invocation's own pixel. - b0414a9f: DepthSurface.cpp:116-118 (writer slot), :141 (depth aspect in `Transfer`), :451 (`SeedStorageFromDepth`), :494 (`DepthSurfaceAt`); ShaderResources.cpp:562. - Mesa: ac_descriptors.c:570-571 (stencil T# at `stencil_offset`), radv_formats.c:118-119. </details>
SP4C3B4R-8 commented 2026-10-06 21:30:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SP4C3B4R-8 on 2026-10-06T21:30:25Z.


@MichonGoddijn231849 agreed on the split, thanks for keeping the branch stable. #454 takes the routing of views with another layout in DepthSurface::Sampled, with the rule from Dean's review: the depth surface is retired when a colour target, a storage write or a CPU write covers its range (the read then goes to guest memory), and the refusal stays while a live depth surface still holds depth newer than guest memory. I'll rebuild #454 on top of this branch (b0414a9f) rather than on main, list #425 under Depends on, and add tests for both orders.

@Pacuka's case on #454 (a 2848x1600 R32 texture over a 1024x1024 D32 surface) should fall under the same rule; I'll ask for a run once the branch is up.

Written with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6025817880 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6025817880). Originally posted by [SP4C3B4R-8](https://github.com/SP4C3B4R-8) on 2026-10-06T21:30:25Z. --- @MichonGoddijn231849 agreed on the split, thanks for keeping the branch stable. #454 takes the routing of views with another layout in `DepthSurface::Sampled`, with the rule from Dean's review: the depth surface is retired when a colour target, a storage write or a CPU write covers its range (the read then goes to guest memory), and the refusal stays while a live depth surface still holds depth newer than guest memory. I'll rebuild #454 on top of this branch (`b0414a9f`) rather than on `main`, list #425 under **Depends on**, and add tests for both orders. @Pacuka's case on #454 (a 2848x1600 R32 texture over a 1024x1024 D32 surface) should fall under the same rule; I'll ask for a run once the branch is up. Written with AI assistance (Claude Code).
MichonGoddijn231849 commented 2026-10-07 08:12:51 +00:00 (Migrated from github.com)

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


@Celegans12 thanks, that's a clear case and you're right that this branch would have made it silent. c50f783d:

  • A storage T# at a depth surface's stencil address throws again (storage access to a depth surface's stencil plane is not implemented), the same outcome as on main, so Yōtei's decal pass is skipped as before instead of writing into an unseeded R8 image the depth surface never reads. The depth plane keeps the seed and take-back.
  • SeedStorageFromDepth applies a pending HTILE fast clear before TakeWrites and the copy, as the sampled paths already do.

Handling the stencil plane properly needs what you listed: writer state per aspect, a seed and take-back of the stencil aspect through a buffer (no storage view of S8 or D32S8 anywhere), and a refusal while the stencil lives in HTILE. That's a follow-up of its own; your test (clear to 0x11, read through R8 storage, write 0x15, read back as stencil) is the right one for it, and I'd take you up on the request file and register dump then.

@SP4C3B4R-8 this is one commit on top of b0414a9f, no rewrite, so #454 can stay on b0414a9f or move up to it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6033825201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6033825201). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T08:12:51Z. --- @Celegans12 thanks, that's a clear case and you're right that this branch would have made it silent. c50f783d: - A storage T# at a depth surface's stencil address throws again (`storage access to a depth surface's stencil plane is not implemented`), the same outcome as on `main`, so Yōtei's decal pass is skipped as before instead of writing into an unseeded R8 image the depth surface never reads. The depth plane keeps the seed and take-back. - `SeedStorageFromDepth` applies a pending HTILE fast clear before `TakeWrites` and the copy, as the sampled paths already do. Handling the stencil plane properly needs what you listed: writer state per aspect, a seed and take-back of the stencil aspect through a buffer (no storage view of S8 or D32S8 anywhere), and a refusal while the stencil lives in HTILE. That's a follow-up of its own; your test (clear to 0x11, read through R8 storage, write 0x15, read back as stencil) is the right one for it, and I'd take you up on the request file and register dump then. @SP4C3B4R-8 this is one commit on top of b0414a9f, no rewrite, so #454 can stay on b0414a9f or move up to it.
MichonGoddijn231849 commented 2026-10-07 17:31:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T17:31:10Z.


Rebased onto current main and the rebased #374 (now d18e8df4), no conflicts. One more commit drops code comments that the conventions check now rejects. #1186 (depth plane arrays from a later base slice) builds on this one. Build and ctest pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6043248142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6043248142). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T17:31:10Z. --- Rebased onto current `main` and the rebased #374 (now d18e8df4), no conflicts. One more commit drops code comments that the conventions check now rejects. #1186 (depth plane arrays from a later base slice) builds on this one. Build and ctest pass.
fisherjoey commented 2026-10-08 05:24:42 +00:00 (Migrated from github.com)

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


This seems to fix #1409: the storage image access to depth/stencil surface ... is not implemented message this PR removes is the one reported there. Adding Closes #1409 to the description would link them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6052973620 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6052973620). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T05:24:42Z. --- This seems to fix #1409: the `storage image access to depth/stencil surface ... is not implemented` message this PR removes is the one reported there. Adding `Closes #1409` to the description would link them.
EdouardSence commented 2026-10-08 13:18:14 +00:00 (Migrated from github.com)

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


Data from a retail title on main + this PR, in case it helps scope the storage path.

Setup

  • Build: main 07c2405c + #759 (needed to boot the title) + this PR. Merged cleanly except docs/dev/TechnicalDebt.md.
  • Hardware: RX 9070 XT (RDNA4), RADV / Mesa 26.2.4, Linux.
  • Title: Astro Bot (PPSA21567). Scripted run from boot through the title screen.

Before / after

  • Without this PR, the run stops at about 60 s on compute shader 0x500798d00: AGC graphics: storage image access to depth/stencil surface 0x53a500000 is not implemented (same as #1409 on another title).
  • With this PR it stops at the same point, on the new, more specific message:
compute shader 0x500798d00: AGC graphics: storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122, dimension 1, 1 mips is not implemented

What the title asks for

  • A D32_SFLOAT surface (126) is bound as a single-mip storage image of the same size in B10G11R11_UFLOAT_PACK32 (122).
  • That is a 32-bit texel, but not one of the R32_* formats DepthSurface.cpp accepts for a 32-bit depth plane.
  • It looks like the title reuses the depth memory as a packed-float target, so supporting it would need a bit-reinterpreting view or copy rather than a same-format storage view.
  • ctest was not run for this combination.

AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060747884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6060747884). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-08T13:18:14Z. --- Data from a retail title on `main` + this PR, in case it helps scope the storage path. **Setup** - Build: `main` 07c2405c + #759 (needed to boot the title) + this PR. Merged cleanly except `docs/dev/TechnicalDebt.md`. - Hardware: RX 9070 XT (RDNA4), RADV / Mesa 26.2.4, Linux. - Title: Astro Bot (PPSA21567). Scripted run from boot through the title screen. **Before / after** - Without this PR, the run stops at about 60 s on `compute shader 0x500798d00: AGC graphics: storage image access to depth/stencil surface 0x53a500000 is not implemented` (same as #1409 on another title). - With this PR it stops at the same point, on the new, more specific message: ``` compute shader 0x500798d00: AGC graphics: storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122, dimension 1, 1 mips is not implemented ``` **What the title asks for** - A D32_SFLOAT surface (126) is bound as a single-mip storage image of the same size in `B10G11R11_UFLOAT_PACK32` (122). - That is a 32-bit texel, but not one of the `R32_*` formats `DepthSurface.cpp` accepts for a 32-bit depth plane. - It looks like the title reuses the depth memory as a packed-float target, so supporting it would need a bit-reinterpreting view or copy rather than a same-format storage view. - `ctest` was not run for this combination. AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.
fisherjoey commented 2026-10-09 01:43:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T01:43:17Z.


Tested with Stray (PPSA02100 v1.05, Unreal Engine 4). This PR fixes #1409 there, and the same shader then needs storage access to the stencil plane.

Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is main 1be6f9f1 + #861 + #1836 + #1837 + #1489 + our open fixes (#1893, #1902, #1904, #1928, #1934), with this PR merged on top.

Without this PR, compute shader 0x200bd80000 aborts the run at about 170 s with storage image access to depth/stencil surface 0x2002320000 is not implemented. With it, the depth plane works and the same shader stops at your guard:

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

The surface is D32S8, 3840x2160. The shader binds its stencil plane as an R8_UINT storage image (guest format 5). A plain image_load of the stencil already works through your sampled stencil view; only the storage binding hits the guard.

I extended your Transfer/writer model to the stencil plane: https://github.com/fisherjoey/AnyPS5/compare/62b1e552...fix/agc-stencil-plane-storage (+34/-7, on your head):

  • Transfer takes an aspect. The stencil plane needs an 8-bit storage format and a single layer; anything else still throws.
  • DepthSurface keeps a stencil writer next to the depth one, and TakeWrites and ApplyFastClear handle both planes.
  • SeedStorageFromStencil seeds it, and cachedStorageTexture calls it instead of throwing.

Test agc_driver_stencil_plane_storage reuses your DepthFastClearHarness. A draw writes stencil 0x5a; a compute image_load has to return 0x5a; a compute image_store of 42 then has to make stencil EQUAL 42 pass everywhere and EQUAL 0x5a nowhere. It fails on your head with the guard message and passes with the change. Your agc_driver_depth_fast_clear tests still pass. With it, Stray gets past this shader and stops later on an unrelated layered-target error.

Feel free to take it into this PR. #1684 does stencil storage separately and lists conflicts with this PR, so this keeps it to one approach.

Also, main added runtime-metadata validation in ShaderResources.cpp (ab0f9985) after this branch's base. Merging this PR onto current main keeps it, but a rebase would make the diff against main read cleanly.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072538597 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6072538597). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T01:43:17Z. --- Tested with Stray (PPSA02100 v1.05, Unreal Engine 4). This PR fixes #1409 there, and the same shader then needs storage access to the stencil plane. Setup: Linux (Nobara 44, kernel 7.2), RTX 5070 Ti, NVIDIA 595.91.07. Base is `main` 1be6f9f1 + #861 + #1836 + #1837 + #1489 + our open fixes (#1893, #1902, #1904, #1928, #1934), with this PR merged on top. Without this PR, compute shader 0x200bd80000 aborts the run at about 170 s with `storage image access to depth/stencil surface 0x2002320000 is not implemented`. With it, the depth plane works and the same shader stops at your guard: ``` AGC graphics: storage access to a depth surface's stencil plane is not implemented ``` The surface is D32S8, 3840x2160. The shader binds its stencil plane as an R8_UINT storage image (guest format 5). A plain `image_load` of the stencil already works through your sampled stencil view; only the storage binding hits the guard. I extended your Transfer/writer model to the stencil plane: https://github.com/fisherjoey/AnyPS5/compare/62b1e552...fix/agc-stencil-plane-storage (+34/-7, on your head): - `Transfer` takes an aspect. The stencil plane needs an 8-bit storage format and a single layer; anything else still throws. - `DepthSurface` keeps a stencil writer next to the depth one, and `TakeWrites` and `ApplyFastClear` handle both planes. - `SeedStorageFromStencil` seeds it, and `cachedStorageTexture` calls it instead of throwing. Test `agc_driver_stencil_plane_storage` reuses your `DepthFastClearHarness`. A draw writes stencil 0x5a; a compute `image_load` has to return 0x5a; a compute `image_store` of 42 then has to make stencil EQUAL 42 pass everywhere and EQUAL 0x5a nowhere. It fails on your head with the guard message and passes with the change. Your `agc_driver_depth_fast_clear` tests still pass. With it, Stray gets past this shader and stops later on an unrelated layered-target error. Feel free to take it into this PR. #1684 does stencil storage separately and lists conflicts with this PR, so this keeps it to one approach. Also, `main` added runtime-metadata validation in `ShaderResources.cpp` (ab0f9985) after this branch's base. Merging this PR onto current `main` keeps it, but a rebase would make the diff against `main` read cleanly. AI-assisted: yes
MichonGoddijn231849 commented 2026-10-09 08:33:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:35Z.


@EdouardSence thanks, that narrows it down: a D32 plane bound as a B10G11R11 storage image needs a bit-reinterpreting view or copy, which is out of scope here, so the more specific error is what this PR should give for now. @fisherjoey nice, the stencil writer next to the depth one is exactly how I'd extend it. Could you open it as a PR on top of this one? That keeps this one reviewable and keeps stencil storage to one approach as you said.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077399923 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6077399923). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-09T08:33:35Z. --- @EdouardSence thanks, that narrows it down: a D32 plane bound as a B10G11R11 storage image needs a bit-reinterpreting view or copy, which is out of scope here, so the more specific error is what this PR should give for now. @fisherjoey nice, the stencil writer next to the depth one is exactly how I'd extend it. Could you open it as a PR on top of this one? That keeps this one reviewable and keeps stencil storage to one approach as you said.
oneandonlydean commented 2026-10-09 09:35:11 +00:00 (Migrated from github.com)

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


DepthPlaneCopy reads and detiles every slice no depth surface holds on every use, even when nothing wrote it. In one level of a heavier title that is most of the frame: about 165,000 layer reads per five-minute run.

Could you keep a guest slice in the staging buffer with the write generation it was read at (GuestMemory::CollectWrites), and read it again only when its address, size or tiling changed, GuestMemory::UnchangedSince fails, Recorder::SnapshotWriteOverlaps reports recorded GPU work writing it, or a depth surface held it in between? That is the same rule a cached sampled texture uses for a hit, plus the pending-write check. Without write watching every use still reads. It's about 30 lines in DepthSurface.cpp, applies cleanly on your head 62b1e552, and I have it with a test if you want it as a commit.

Level fps, level start +30 to +150 s, warm caches, two runs each (#425 alone doesn't get the title to the level, so the base also has the other fixes it needs):

build level fps guest reads per run
base 0.091 567 GiB
base + this 0.163 / 0.162 280 GiB
base + #1059 + this 0.455 / 0.448 17 GiB
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078309634 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6078309634). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:35:11Z. --- `DepthPlaneCopy` reads and detiles every slice no depth surface holds on every use, even when nothing wrote it. In one level of a heavier title that is most of the frame: about 165,000 layer reads per five-minute run. Could you keep a guest slice in the staging buffer with the write generation it was read at (`GuestMemory::CollectWrites`), and read it again only when its address, size or tiling changed, `GuestMemory::UnchangedSince` fails, `Recorder::SnapshotWriteOverlaps` reports recorded GPU work writing it, or a depth surface held it in between? That is the same rule a cached sampled texture uses for a hit, plus the pending-write check. Without write watching every use still reads. It's about 30 lines in `DepthSurface.cpp`, applies cleanly on your head 62b1e552, and I have it with a test if you want it as a commit. Level fps, level start +30 to +150 s, warm caches, two runs each (#425 alone doesn't get the title to the level, so the base also has the other fixes it needs): | build | level fps | guest reads per run | |---|---|---| | base | 0.091 | 567 GiB | | base + this | 0.163 / 0.162 | 280 GiB | | base + #1059 + this | 0.455 / 0.448 | 17 GiB |
MichonGoddijn231849 commented 2026-10-09 14:39:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T14:39:39Z.


Thanks, that is a clear win (and nice numbers). Yes please, could you open it as a follow-up PR on top of this one with your test? That keeps this PR small and credits your change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083131950 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6083131950). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-09T14:39:39Z. --- Thanks, that is a clear win (and nice numbers). Yes please, could you open it as a follow-up PR on top of this one with your test? That keeps this PR small and credits your change.
NahuelGenchi commented 2026-10-09 14:47:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-09T14:47:35Z.


Another title this helps: Sonic Origins (PPSA05324) on Linux, R9 380 (RADV). Once its clears run (#2022, #1902, #1928, #2219), a compute pass stops at storage image access to depth/stencil surface ... is not implemented. With this PR merged on top (only docs/dev/TechnicalDebt.md conflicted), it gets past that and presents its boot frames.

Bring-up thread: #2021

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083266810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6083266810). Originally posted by [NahuelGenchi](https://github.com/NahuelGenchi) on 2026-10-09T14:47:35Z. --- Another title this helps: Sonic Origins (PPSA05324) on Linux, R9 380 (RADV). Once its clears run (#2022, #1902, #1928, #2219), a compute pass stops at `storage image access to depth/stencil surface ... is not implemented`. With this PR merged on top (only `docs/dev/TechnicalDebt.md` conflicted), it gets past that and presents its boot frames. Bring-up thread: #2021
fisherjoey commented 2026-10-09 15:33:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T15:33:12Z.


Opened as #2325, on top of this PR's head (Depends on #425). It has the same change and the agc_driver_stencil_plane_storage test. On Stray the stencil guard no longer fires with it.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084053940 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6084053940). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T15:33:12Z. --- Opened as #2325, on top of this PR's head (Depends on #425). It has the same change and the `agc_driver_stencil_plane_storage` test. On Stray the stencil guard no longer fires with it. AI-assisted: yes
JAB-dev commented 2026-10-09 17:45:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-09T17:45:47Z.


Seeker: My Shadow (PPSA12500, Unity) samples a 1024x1024 D32 depth surface as a cube (point-light shadows) and stops with sampling the depth plane ... dimension 3 ... is not implemented. With this PR it renders past that.

Heads-up: it conflicts with #2169/#419 in DepthSurface.cpp, State.hpp, BufferFill.cpp, PacketMemory.cpp and the graphics test, since both carry #374 rebased differently. Resolving was mostly keeping both sides, plus adding writer.reset()/seeded = nullptr to #419's ApplyFastClear. agc_driver_graphics passes on the merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086182956 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6086182956). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-09T17:45:47Z. --- Seeker: My Shadow (PPSA12500, Unity) samples a 1024x1024 D32 depth surface as a cube (point-light shadows) and stops with `sampling the depth plane ... dimension 3 ... is not implemented`. With this PR it renders past that. Heads-up: it conflicts with #2169/#419 in `DepthSurface.cpp`, `State.hpp`, `BufferFill.cpp`, `PacketMemory.cpp` and the graphics test, since both carry #374 rebased differently. Resolving was mostly keeping both sides, plus adding `writer.reset()`/`seeded = nullptr` to #419's `ApplyFastClear`. `agc_driver_graphics` passes on the merge.
popcoder565 commented 2026-10-09 19:03:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:03:33Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 62b1e552, alone on main ae3d5f95.

agc_driver_depth_fast_clear_submit fails intermittently: 3 of 60 runs under ctest and 16 of 120 run directly. It always fails at the same check:

AGC graphics: a compute fill of 0 over the HTILE did not clear the depth to DB_DEPTH_CLEAR (1.0)

The rest of the suite passes (509 of 509). #2076 and the now closed #2325 carry the same test file, and it fails the same way with #2325.

I traced it with local logging on #2325's head. The fill isn't missed: it's noted (pendingClear = depth), and the next draw's DepthSurfaceView applies the clear with depth 1.0. The problem is which recorder records that clear:

[probe] draw on device …00d0: own recorder …2060, active recorder …e700
[probe] apply clear aspects=2 depth=1.000000 on device …00d0 via recorder …e700
  • VulkanDevice activates its recorder only in its constructor, and Recorder::Active() is process-wide. The test opens its own device for the draws. The active recorder changes to another one right when the compute fill is submitted, which matches the driver creating its own device there.
  • From then on, ApplyFastClear records the clear for the test device's depth image into the driver's recorder. That is another VkDevice's command buffer, with no ordering against the test's draw. Before the compute fill the active recorder is still the test device's own, which would explain why the DMA variant passes.

So this looks like a problem with two devices in one test process, not with the HTILE handling. Drawing through the same device as the DCB path, or keeping the dispatch off the driver's device, should avoid it.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087415872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6087415872). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:03:33Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `62b1e552`, alone on `main` ae3d5f95. **`agc_driver_depth_fast_clear_submit` fails intermittently:** 3 of 60 runs under ctest and 16 of 120 run directly. It always fails at the same check: ``` AGC graphics: a compute fill of 0 over the HTILE did not clear the depth to DB_DEPTH_CLEAR (1.0) ``` The rest of the suite passes (509 of 509). #2076 and the now closed #2325 carry the same test file, and it fails the same way with #2325. I traced it with local logging on #2325's head. The fill isn't missed: it's noted (`pendingClear` = depth), and the next draw's `DepthSurfaceView` applies the clear with depth 1.0. The problem is which recorder records that clear: ``` [probe] draw on device …00d0: own recorder …2060, active recorder …e700 [probe] apply clear aspects=2 depth=1.000000 on device …00d0 via recorder …e700 ``` - `VulkanDevice` activates its recorder only in its constructor, and `Recorder::Active()` is process-wide. The test opens its own device for the draws. The active recorder changes to another one right when the compute fill is submitted, which matches the driver creating its own device there. - From then on, `ApplyFastClear` records the clear for the test device's depth image into the driver's recorder. That is another `VkDevice`'s command buffer, with no ordering against the test's draw. Before the compute fill the active recorder is still the test device's own, which would explain why the DMA variant passes. So this looks like a problem with two devices in one test process, not with the HTILE handling. Drawing through the same device as the DCB path, or keeping the dispatch off the driver's device, should avoid it. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
MichonGoddijn231849 commented 2026-10-09 22:14:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T22:14:18Z.


Thanks all: Sonic Origins, Seeker: My Shadow and the Windows run are useful data points.

@popcoder565 thanks for tracing it, the diagnosis holds. agc_driver_depth_fast_clear_submit opens its own device for the draws. When the compute fill is submitted, the driver creates its own device, and from then on Recorder::Active() (process-wide) points at the driver's recorder. ApplyFastClear then records the test device's clear into another device's command buffer, with no ordering against the draw. The test comes from #374. I'll fix it there tomorrow by making the test draw through the driver's device, like the DCB variant. This PR then picks the fix up when it is rebased.

@fisherjoey thanks for #2325; I'll look at it again once #374 and this one land.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090138042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6090138042). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-09T22:14:18Z. --- Thanks all: Sonic Origins, Seeker: My Shadow and the Windows run are useful data points. @popcoder565 thanks for tracing it, the diagnosis holds. `agc_driver_depth_fast_clear_submit` opens its own device for the draws. When the compute fill is submitted, the driver creates its own device, and from then on `Recorder::Active()` (process-wide) points at the driver's recorder. `ApplyFastClear` then records the test device's clear into another device's command buffer, with no ordering against the draw. The test comes from #374. I'll fix it there tomorrow by making the test draw through the driver's device, like the DCB variant. This PR then picks the fix up when it is rebased. @fisherjoey thanks for #2325; I'll look at it again once #374 and this one land.
oneandonlydean commented 2026-10-10 01:28:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T01:28:30Z.


This conflicts with main now. Could you rebase it (onto #374's head, or onto main once #374 is in, since its build is running)? #2490 and #2491 are stacked on it and will follow.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092183652 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6092183652). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T01:28:30Z. --- This conflicts with main now. Could you rebase it (onto #374's head, or onto main once #374 is in, since its build is running)? #2490 and #2491 are stacked on it and will follow.
MichonGoddijn231849 commented 2026-10-10 08:22:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T08:22:30Z.


Rebased onto #374's new head (28414f92, itself on main af1a8edf), head e6451eee. When #374 merges, its two commits drop out of this diff.

The rebase needed one fix commit (e6451eee) to fit main:

  • DepthSurfaceTexture keeps main's reused-memory rule (9d65003c): a view of another extent, or of an unrelated format, over a depth surface's memory reads as reused memory.
  • A raw depth-bits view samples the depth plane directly, as main does. This PR's integer plane copy is now only for an R16_UINT view that isn't one. Main's DepthSurfaceReuse test caught this.
  • The storage transfer, fast clear and plane copy record on the surface's own device, like #374's fix for the flaky submit test.

Tested on Windows, RTX 5080:

  • agc_driver_graphics (with DepthSurfaceReuse), agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit, agc_driver_depth_bias_per_face and agc_driver_dword_pattern_fill pass.
  • check_conventions.py passes.

@oneandonlydean your #2490 and #2491 sit on the old head and need the same rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095636584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6095636584). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T08:22:30Z. --- Rebased onto #374's new head (`28414f92`, itself on `main` af1a8edf), head `e6451eee`. When #374 merges, its two commits drop out of this diff. The rebase needed one fix commit (`e6451eee`) to fit main: - `DepthSurfaceTexture` keeps main's reused-memory rule (9d65003c): a view of another extent, or of an unrelated format, over a depth surface's memory reads as reused memory. - A raw depth-bits view samples the depth plane directly, as main does. This PR's integer plane copy is now only for an R16_UINT view that isn't one. Main's `DepthSurfaceReuse` test caught this. - The storage transfer, fast clear and plane copy record on the surface's own device, like #374's fix for the flaky submit test. Tested on Windows, RTX 5080: - `agc_driver_graphics` (with `DepthSurfaceReuse`), `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit`, `agc_driver_depth_bias_per_face` and `agc_driver_dword_pattern_fill` pass. - `check_conventions.py` passes. @oneandonlydean your #2490 and #2491 sit on the old head and need the same rebase.
oneandonlydean commented 2026-10-10 08:23:55 +00:00 (Migrated from github.com)

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


Rebased onto #374's new head (28414f92, itself on main af1a8ed), head e6451eee. When #374 merges, its two commits drop out of this diff.

The rebase needed one fix commit (e6451eee) to fit main:

  • DepthSurfaceTexture keeps main's reused-memory rule (9d65003): a view of another extent, or of an unrelated format, over a depth surface's memory reads as reused memory.
  • A raw depth-bits view samples the depth plane directly, as main does. This PR's integer plane copy is now only for an R16_UINT view that isn't one. Main's DepthSurfaceReuse test caught this.
  • The storage transfer, fast clear and plane copy record on the surface's own device, like fix(agc): depth fast clears through the HTILE metadata #374's fix for the flaky submit test.

Tested on Windows, RTX 5080:

  • agc_driver_graphics (with DepthSurfaceReuse), agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit, agc_driver_depth_bias_per_face and agc_driver_dword_pattern_fill pass.
  • check_conventions.py passes.

@oneandonlydean your #2490 and #2491 sit on the old head and need the same rebase.

thank you!!!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095647057 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6095647057). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T08:23:55Z. --- > Rebased onto #374's new head (`28414f92`, itself on `main` [af1a8ed](https://github.com/boykopovar/AnyPS5/commit/af1a8edfe1a868e70b7e46d88c13677156d2203d)), head `e6451eee`. When #374 merges, its two commits drop out of this diff. > > The rebase needed one fix commit (`e6451eee`) to fit main: > > * `DepthSurfaceTexture` keeps main's reused-memory rule ([9d65003](https://github.com/boykopovar/AnyPS5/commit/9d65003ced1e74491060eac82a032c0ba31345f4)): a view of another extent, or of an unrelated format, over a depth surface's memory reads as reused memory. > * A raw depth-bits view samples the depth plane directly, as main does. This PR's integer plane copy is now only for an R16_UINT view that isn't one. Main's `DepthSurfaceReuse` test caught this. > * The storage transfer, fast clear and plane copy record on the surface's own device, like [fix(agc): depth fast clears through the HTILE metadata #374](https://github.com/boykopovar/AnyPS5/pull/374)'s fix for the flaky submit test. > > Tested on Windows, RTX 5080: > > * `agc_driver_graphics` (with `DepthSurfaceReuse`), `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit`, `agc_driver_depth_bias_per_face` and `agc_driver_dword_pattern_fill` pass. > * `check_conventions.py` passes. > > @oneandonlydean your #2490 and #2491 sit on the old head and need the same rebase. thank you!!!
oneandonlydean commented 2026-10-10 09:42:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T09:42:36Z.


Could you rebase this on main after #374? It conflicts in core/libs/prx/libSceAgcDriver/tests/Graphics.cpp. It merges right after #374.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096230867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6096230867). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T09:42:36Z. --- Could you rebase this on main after #374? It conflicts in `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`. It merges right after #374.
MichonGoddijn231849 commented 2026-10-10 09:54:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T09:54:32Z.


Rebased onto #374's new head (94d93e00, on main be403084), head d6088bed. No conflicts this time. agc_driver_graphics, agc_driver_depth_fast_clear(_submit), agc_driver_depth_bias_per_face, agc_driver_dword_pattern_fill and check_conventions.py pass here. Once #374 is merged, its three commits drop out of this diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096316926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6096316926). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T09:54:32Z. --- Rebased onto #374's new head (`94d93e00`, on `main` be403084), head `d6088bed`. No conflicts this time. `agc_driver_graphics`, `agc_driver_depth_fast_clear(_submit)`, `agc_driver_depth_bias_per_face`, `agc_driver_dword_pattern_fill` and `check_conventions.py` pass here. Once #374 is merged, its three commits drop out of this diff.
oneandonlydean commented 2026-10-10 11:23:00 +00:00 (Migrated from github.com)

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


Astro Bot on current main with this PR (plus #2647, #1745 and #2653) now reaches the Space Station level, then stops at once on:

storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122, dimension 1, 1 mips is not implemented

A D32 depth surface written as a storage image of another 32-bit format. With the two lines below on your head it runs the level for the full 300 s with no stop, no skipped draws and no errors:

  • the storage check accepts any one-texel-wide format of the depth's byte size, not only the R16/R32 list;
  • a sample whose format is the storage writer's own (and not the depth-plane format) goes to the plain texture path instead of the depth plane.

Could you fold this into the PR, or say if you'd rather have it as a follow-up?

@@ -128,7 +128,7 @@ public:
         const auto& descriptor = storage.Descriptor();
         const bool d16 = target.format == VK_FORMAT_D16_UNORM || target.format == VK_FORMAT_D16_UNORM_S8_UINT;
         const auto storageFormat = storage.StorageFormat();
-        const bool sized = d16 ? (storageFormat == VK_FORMAT_R16_UINT || storageFormat == VK_FORMAT_R16_UNORM || storageFormat == VK_FORMAT_R16_SINT || storageFormat == VK_FORMAT_R16_SNORM || storageFormat == VK_FORMAT_R16_SFLOAT) : (storageFormat == VK_FORMAT_R32_SFLOAT || storageFormat == VK_FORMAT_R32_UINT || storageFormat == VK_FORMAT_R32_SINT);
+        const bool sized = BlockWidth(descriptor.format) == 1 && BytesPerElement(descriptor.format) == (d16 ? 2u : 4u);
         if (!sized || descriptor.width != target.extent.width || descriptor.height != target.extent.height || descriptor.mipCount != 1 || (descriptor.dimension != TextureDimension::k2D && descriptor.dimension != TextureDimension::k2DArray) || (layer != 0 && layer > descriptor.depthOrLastArray)) {
             char text[256];
             std::snprintf(text, sizeof(text), "AGC graphics: storage image access to depth surface 0x%llx (%ux%u, vk format %d) as a %ux%u image of vk format %d, dimension %d, %u mips is not implemented", static_cast<unsigned long long>(target.address), target.extent.width, target.extent.height, static_cast<int>(target.format), descriptor.width, descriptor.height, static_cast<int>(storageFormat), static_cast<int>(descriptor.dimension), descriptor.mipCount);
@@ -448,6 +448,7 @@ std::shared_ptr<Texture> DepthSurfaceTexture(const Context& context, std::span<c
     const bool depthBits = !stencil && words.size() >= 4 && ShaderRecompiler::DepthBitsTextureWidth(words[1], words[3]) == (d16 ? 16u : 32u);
     const bool integer = d16 && format == VK_FORMAT_R16_UINT && !depthBits;
     if (!stencil && format != (d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT) && !depthBits && !integer) return nullptr;
+    if (const auto writer = (*found)->writer.lock(); writer != nullptr && base.address == resource.baseAddress && writer->StorageFormat() == format && format != VK_FORMAT_R32_SFLOAT && format != VK_FORMAT_R16_UNORM) return nullptr;
     (*found)->ApplyFastClear();
     (*found)->TakeWrites();
     const bool cube = resource.dimension == TextureDimension::kCube;
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096979000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6096979000). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T11:23:00Z. --- Astro Bot on current main with this PR (plus #2647, #1745 and #2653) now reaches the Space Station level, then stops at once on: ``` storage image access to depth surface 0x53a500000 (960x540, vk format 126) as a 960x540 image of vk format 122, dimension 1, 1 mips is not implemented ``` A D32 depth surface written as a storage image of another 32-bit format. With the two lines below on your head it runs the level for the full 300 s with no stop, no skipped draws and no errors: - the storage check accepts any one-texel-wide format of the depth's byte size, not only the R16/R32 list; - a sample whose format is the storage writer's own (and not the depth-plane format) goes to the plain texture path instead of the depth plane. Could you fold this into the PR, or say if you'd rather have it as a follow-up? ```diff @@ -128,7 +128,7 @@ public: const auto& descriptor = storage.Descriptor(); const bool d16 = target.format == VK_FORMAT_D16_UNORM || target.format == VK_FORMAT_D16_UNORM_S8_UINT; const auto storageFormat = storage.StorageFormat(); - const bool sized = d16 ? (storageFormat == VK_FORMAT_R16_UINT || storageFormat == VK_FORMAT_R16_UNORM || storageFormat == VK_FORMAT_R16_SINT || storageFormat == VK_FORMAT_R16_SNORM || storageFormat == VK_FORMAT_R16_SFLOAT) : (storageFormat == VK_FORMAT_R32_SFLOAT || storageFormat == VK_FORMAT_R32_UINT || storageFormat == VK_FORMAT_R32_SINT); + const bool sized = BlockWidth(descriptor.format) == 1 && BytesPerElement(descriptor.format) == (d16 ? 2u : 4u); if (!sized || descriptor.width != target.extent.width || descriptor.height != target.extent.height || descriptor.mipCount != 1 || (descriptor.dimension != TextureDimension::k2D && descriptor.dimension != TextureDimension::k2DArray) || (layer != 0 && layer > descriptor.depthOrLastArray)) { char text[256]; std::snprintf(text, sizeof(text), "AGC graphics: storage image access to depth surface 0x%llx (%ux%u, vk format %d) as a %ux%u image of vk format %d, dimension %d, %u mips is not implemented", static_cast<unsigned long long>(target.address), target.extent.width, target.extent.height, static_cast<int>(target.format), descriptor.width, descriptor.height, static_cast<int>(storageFormat), static_cast<int>(descriptor.dimension), descriptor.mipCount); @@ -448,6 +448,7 @@ std::shared_ptr<Texture> DepthSurfaceTexture(const Context& context, std::span<c const bool depthBits = !stencil && words.size() >= 4 && ShaderRecompiler::DepthBitsTextureWidth(words[1], words[3]) == (d16 ? 16u : 32u); const bool integer = d16 && format == VK_FORMAT_R16_UINT && !depthBits; if (!stencil && format != (d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT) && !depthBits && !integer) return nullptr; + if (const auto writer = (*found)->writer.lock(); writer != nullptr && base.address == resource.baseAddress && writer->StorageFormat() == format && format != VK_FORMAT_R32_SFLOAT && format != VK_FORMAT_R16_UNORM) return nullptr; (*found)->ApplyFastClear(); (*found)->TakeWrites(); const bool cube = resource.dimension == TextureDimension::kCube; ```
AlxcBTW commented 2026-10-10 16:48:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-10T16:48:25Z.


Data point from a retail Unreal title, Taxi Chaos 2 (PPSA30279 v01.007.000), which stops on:

AGC graphics: sampling the depth plane of depth surface 0x3051ca0000 (512x512, vk format 124) as a 512x512 texture of guest format 7 (vk 70), tile mode 4, dimension 3, levels 0-0, slice 0 is not implemented

With this PR applied locally, the title gets past it. The same local build also has #2054 and a local workaround for #1409. Its next stop is #2102 (color views of several array slices are unsupported).

Windows 11 26200, Radeon 880M (ANYPS5_GPU=AMD). Dump from my own copy; no game files are shared.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099872467 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6099872467). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-10T16:48:25Z. --- Data point from a retail Unreal title, Taxi Chaos 2 (PPSA30279 v01.007.000), which stops on: ``` AGC graphics: sampling the depth plane of depth surface 0x3051ca0000 (512x512, vk format 124) as a 512x512 texture of guest format 7 (vk 70), tile mode 4, dimension 3, levels 0-0, slice 0 is not implemented ``` With this PR applied locally, the title gets past it. The same local build also has #2054 and a local workaround for #1409. Its next stop is #2102 (`color views of several array slices are unsupported`). Windows 11 26200, Radeon 880M (`ANYPS5_GPU=AMD`). Dump from my own copy; no game files are shared. AI-assisted: yes
ponhei9502 commented 2026-10-10 20:25:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ponhei9502 on 2026-10-10T20:25:07Z.


A data point from Demon's Souls (PPSA01341) on Linux / RTX 3080, tree main 3cb317fc + this PR at d6088bed (+ #757 and local Linux fixes): before this PR the title stopped on storage image access to depth/stencil surface 0x2c25b0000 is not implemented; with it, the same compute dispatch now reports

compute shader 0x848934000: AGC graphics: storage image access to depth surface 0x8c25b0000 (1024x1024, vk format 126)
as a 1280x720 image of vk format 97, dimension 1, 1 mips is not implemented

So the storage descriptor at that address is a 1280x720 16-bit float colour image (guest format 71, tile mode 7), while the recorded depth surface there is a 1024x1024 D32 target. The sizes do not match at all, which makes me think the title reused the memory of an earlier 1024x1024 depth target (a shadow map) for a colour image, and the depth-surface record for that address is stale by then, rather than the shader reading depth through a storage view. I have not verified when the depth target was last bound; I can add a trace for that if it is useful.

Reproduction: +ds_enableDebugStartMenu=true, Cross on "Walk Through", Cross on "(0-1) Nexus"; it happens during the level load, about 7 minutes in on a cold shader cache.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101827400 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6101827400). Originally posted by [ponhei9502](https://github.com/ponhei9502) on 2026-10-10T20:25:07Z. --- A data point from Demon's Souls (PPSA01341) on Linux / RTX 3080, tree `main` 3cb317fc + this PR at d6088bed (+ #757 and local Linux fixes): before this PR the title stopped on `storage image access to depth/stencil surface 0x2c25b0000 is not implemented`; with it, the same compute dispatch now reports ``` compute shader 0x848934000: AGC graphics: storage image access to depth surface 0x8c25b0000 (1024x1024, vk format 126) as a 1280x720 image of vk format 97, dimension 1, 1 mips is not implemented ``` So the storage descriptor at that address is a 1280x720 16-bit float colour image (guest format 71, tile mode 7), while the recorded depth surface there is a 1024x1024 D32 target. The sizes do not match at all, which makes me think the title reused the memory of an earlier 1024x1024 depth target (a shadow map) for a colour image, and the depth-surface record for that address is stale by then, rather than the shader reading depth through a storage view. I have not verified when the depth target was last bound; I can add a trace for that if it is useful. Reproduction: `+ds_enableDebugStartMenu=true`, Cross on "Walk Through", Cross on "(0-1) Nexus"; it happens during the level load, about 7 minutes in on a cold shader cache. AI-assisted: yes
MichonGoddijn231849 commented 2026-10-10 22:17:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T22:17:27Z.


@AlxcBTW thanks for the Taxi Chaos 2 run. color views of several array slices (#2102) is a separate gap, not part of this PR.

@ponhei9502 agreed, that reads like a stale depth-surface record: the memory of a 1024x1024 D32 target (likely a shadow map) reused for a 1280x720 16-bit float colour image, and the storage view still resolving to the old depth surface. The fix for that is to drop or ignore the depth-surface record once the memory is bound as a colour image of another shape, which is outside this PR's sampling path; I'll take it as a follow-up after this merges. A trace of when the depth target was last bound (draw or clear) before that dispatch would help confirm it, yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102768209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6102768209). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T22:17:27Z. --- @AlxcBTW thanks for the Taxi Chaos 2 run. `color views of several array slices` (#2102) is a separate gap, not part of this PR. @ponhei9502 agreed, that reads like a stale depth-surface record: the memory of a 1024x1024 D32 target (likely a shadow map) reused for a 1280x720 16-bit float colour image, and the storage view still resolving to the old depth surface. The fix for that is to drop or ignore the depth-surface record once the memory is bound as a colour image of another shape, which is outside this PR's sampling path; I'll take it as a follow-up after this merges. A trace of when the depth target was last bound (draw or clear) before that dispatch would help confirm it, yes.
MichonGoddijn231849 commented 2026-10-10 22:38:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T22:38:45Z.


Rebased onto #374's new head (6d0fe18c, on main 379d8b4e) as f98ed5a2, no conflicts. 326/326 agc tests pass on Windows (RTX 5080).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102937983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6102937983). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T22:38:45Z. --- Rebased onto #374's new head (`6d0fe18c`, on main `379d8b4e`) as `f98ed5a2`, no conflicts. 326/326 agc tests pass on Windows (RTX 5080).
orishamir commented 2026-10-10 22:59:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T22:59:28Z.


Replica run of f98ed5a2 (same CI-image setup as on #374: ubuntu:24.04, GCC 13.3, llvmpipe LLVM 20.1.2, SPIRV-Tools on, CI env, userfaultfd write watch active; the tree as pushed, i.e. #374 6d0fe18c plus this PR's four commits), since CI's linux job does not run on pull requests.

  • The rebase is clean: the patch on top of #374 is identical to d6088bed on 94d93e00 (interdiff of added and removed lines empty; 5 files, +321/-41).
  • Build and libs clean. Full suite 729/729 three times at --parallel 4; agc_driver_depth_fast_clear_submit 30/30 serial.

AI-assisted: yes (Claude Code Fable 5.1 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103096744 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6103096744). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-10T22:59:28Z. --- Replica run of `f98ed5a2` (same CI-image setup as on #374: ubuntu:24.04, GCC 13.3, llvmpipe LLVM 20.1.2, SPIRV-Tools on, CI env, userfaultfd write watch active; the tree as pushed, i.e. #374 `6d0fe18c` plus this PR's four commits), since CI's `linux` job does not run on pull requests. - The rebase is clean: the patch on top of #374 is identical to `d6088bed` on `94d93e00` (interdiff of added and removed lines empty; 5 files, +321/-41). - Build and `libs` clean. Full suite 729/729 three times at `--parallel 4`; `agc_driver_depth_fast_clear_submit` 30/30 serial. AI-assisted: yes (Claude Code Fable 5.1 xhigh)
xXPBSXx commented 2026-10-11 07:52:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T07:52:58Z.


Test of this PR on two titles stopped by #1409, Windows, merged into a local test branch with current main (06da1176) and my other fix branches. The merge has two additive conflicts (DepthSurface.hpp, DepthSurface.cpp: main adds DepthSurfaceHolds/Holds, this PR adds the plane and transfer helpers); I kept both sides, the build is clean and the agc_driver_depth* tests pass. A rebase onto current main is needed before it can merge.

  • Puyo Puyo Tetris 2 (PPSA01530): the storage image access to depth/stencil surface ... is not implemented stop is gone. The title now stops at compute shader 0x1417c4300: buffer descriptor uses an unsupported type in a 100 s run. I have not looked at what that descriptor is.
  • Ad Infinitum (PPSA10600): the same stop is gone and it stops at compute shader 0x200ac30000: AGC graphics: storage access to a depth surface's stencil plane is not implemented, which is the stencil limit this PR documents.

I did not look at the picture in either run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106864781 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6106864781). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T07:52:58Z. --- Test of this PR on two titles stopped by #1409, Windows, merged into a local test branch with current `main` (06da1176) and my other fix branches. The merge has two additive conflicts (`DepthSurface.hpp`, `DepthSurface.cpp`: `main` adds `DepthSurfaceHolds`/`Holds`, this PR adds the plane and transfer helpers); I kept both sides, the build is clean and the `agc_driver_depth*` tests pass. A rebase onto current `main` is needed before it can merge. - Puyo Puyo Tetris 2 (PPSA01530): the `storage image access to depth/stencil surface ... is not implemented` stop is gone. The title now stops at `compute shader 0x1417c4300: buffer descriptor uses an unsupported type` in a 100 s run. I have not looked at what that descriptor is. - Ad Infinitum (PPSA10600): the same stop is gone and it stops at `compute shader 0x200ac30000: AGC graphics: storage access to a depth surface's stencil plane is not implemented`, which is the stencil limit this PR documents. I did not look at the picture in either run. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 07:59:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T07:59:21Z.


Detail for the Puyo Puyo Tetris 2 stop I reported above (compute shader 0x1417c4300: buffer descriptor uses an unsupported type). With a temporary local print in materializeTables (not proposed), the buffer descriptor at index 0 that fails the type check has the dwords

02100b00 c3c00000 010dc1df 91b00fac   (Type() = 2)

Dword 3 is 0x91b00fac, so bits 31:30 are 0b10. I do not know whether this is an image descriptor read where a buffer was expected, an uninitialised table entry, or a genuine other resource type; I only know that the check sees type 2. It is a different problem from the depth-surface one and does not depend on this PR.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106911983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6106911983). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T07:59:21Z. --- Detail for the Puyo Puyo Tetris 2 stop I reported above (`compute shader 0x1417c4300: buffer descriptor uses an unsupported type`). With a temporary local print in `materializeTables` (not proposed), the buffer descriptor at index 0 that fails the type check has the dwords ``` 02100b00 c3c00000 010dc1df 91b00fac (Type() = 2) ``` Dword 3 is `0x91b00fac`, so bits 31:30 are `0b10`. I do not know whether this is an image descriptor read where a buffer was expected, an uninitialised table entry, or a genuine other resource type; I only know that the check sees type 2. It is a different problem from the depth-surface one and does not depend on this PR. AI-assisted (Claude Code).
adriadam10 commented 2026-10-11 10:25:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:25:27Z.

Review: DISMISSED


#374 is merged, so this needs a rebase onto current main; its commits now drop out of the diff. Rebasing the four commits of this PR on main (99c1c263) conflicts in logic, not only adjacency:

  • Graphics/include/Texture.hpp: main (d024709cf) added the depth-copy API (DepthCopyTag constructor, IsDepthCopy, RefreshDepthCopy, TakeDepthCopyCounts) next to the Texture(..., VkImageViewType viewType) constructor and refreshedPerUse this PR adds. The two refresh-per-use mechanisms need to be reconciled (one flag, or one reusing the other).
  • Graphics/src/DepthSurface.cpp: main's DepthSurface::Holds / DepthSurfaceHolds (2828fdc8c) versus this PR's writer/seeded/Transfer; DepthSurfaceHolds should say what it returns for the per-use DepthPlaneCopy textures.
  • Graphics/src/ShaderResources.cpp noteReusable: main now returns early on HasCopiedWrites() || HoldsLease() || usesBda || ...; the RefreshedPerUse() check has to be added to that condition, not to the old one.
  • tests/Graphics.cpp, docs/dev/TechnicalDebt.md: adjacency only.

After the rebase please rerun agc_driver_graphics, agc_driver_depth_fast_clear and agc_driver_depth_fast_clear_submit, and add the Closes #1409 line reported by fisherjoey. We'll review again once it is on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482939773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#pullrequestreview-5482939773). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T10:25:27Z. **Review:** DISMISSED --- #374 is merged, so this needs a rebase onto current `main`; its commits now drop out of the diff. Rebasing the four commits of this PR on `main` (`99c1c263`) conflicts in logic, not only adjacency: - `Graphics/include/Texture.hpp`: `main` (d024709cf) added the depth-copy API (`DepthCopyTag` constructor, `IsDepthCopy`, `RefreshDepthCopy`, `TakeDepthCopyCounts`) next to the `Texture(..., VkImageViewType viewType)` constructor and `refreshedPerUse` this PR adds. The two refresh-per-use mechanisms need to be reconciled (one flag, or one reusing the other). - `Graphics/src/DepthSurface.cpp`: `main`'s `DepthSurface::Holds` / `DepthSurfaceHolds` (2828fdc8c) versus this PR's `writer`/`seeded`/`Transfer`; `DepthSurfaceHolds` should say what it returns for the per-use `DepthPlaneCopy` textures. - `Graphics/src/ShaderResources.cpp` `noteReusable`: `main` now returns early on `HasCopiedWrites() || HoldsLease() || usesBda || ...`; the `RefreshedPerUse()` check has to be added to that condition, not to the old one. - `tests/Graphics.cpp`, `docs/dev/TechnicalDebt.md`: adjacency only. After the rebase please rerun `agc_driver_graphics`, `agc_driver_depth_fast_clear` and `agc_driver_depth_fast_clear_submit`, and add the `Closes #1409` line reported by fisherjoey. We'll review again once it is on `main`.
ThatsLeo commented 2026-10-11 12:01:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T12:01:06Z.


Stray (PPSA02101 v01.002, UE4) needs this PR and one step more. Without it, the title stops at its first compute pass over a depth surface:

compute shader 0x200bc70000: AGC graphics: storage image access to depth/stencil surface 0x20325a0000 is not implemented

With it, Stray next asks for the stencil plane as a storage image, which this PR keeps refusing:

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

A commit for that, on this PR's head 847cccc6: ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage (one commit, 8c46503d). It follows the depth path:

  • the stencil plane goes through an R8 storage image (R8_UINT, R8_UNORM, R8_SINT, R8_SNORM), with a staging buffer of its own;
  • each plane keeps its own writer, so a surface whose depth and stencil planes are both open as storage images takes back both;
  • slices of a layered stencil plane are DepthSliceBytes apart at 1 byte per texel;
  • DepthStencilPlaneAt and its refusal go away.

With both, Stray goes past these passes and renders its first screens (#2749). The commit has no test of its own, and this PR has none for depth storage access yet either. If you want one, I can write it for both planes. agc_driver_depth_* pass on Intel Arc and lavapipe.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108799835 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6108799835). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T12:01:06Z. --- Stray (PPSA02101 v01.002, UE4) needs this PR and one step more. Without it, the title stops at its first compute pass over a depth surface: ``` compute shader 0x200bc70000: AGC graphics: storage image access to depth/stencil surface 0x20325a0000 is not implemented ``` With it, Stray next asks for the stencil plane as a storage image, which this PR keeps refusing: ``` compute shader ...: AGC graphics: storage access to a depth surface's stencil plane is not implemented ``` A commit for that, on this PR's head `847cccc6`: [`ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage`](https://github.com/ThatsLeo/AnyPS5/tree/feat/agc-depth-stencil-storage) (one commit, `8c46503d`). It follows the depth path: - the stencil plane goes through an R8 storage image (`R8_UINT`, `R8_UNORM`, `R8_SINT`, `R8_SNORM`), with a staging buffer of its own; - each plane keeps its own writer, so a surface whose depth and stencil planes are both open as storage images takes back both; - slices of a layered stencil plane are `DepthSliceBytes` apart at 1 byte per texel; - `DepthStencilPlaneAt` and its refusal go away. With both, Stray goes past these passes and renders its first screens (#2749). The commit has no test of its own, and this PR has none for depth storage access yet either. If you want one, I can write it for both planes. `agc_driver_depth_*` pass on Intel Arc and lavapipe. AI-assisted: yes.
MichonGoddijn231849 commented 2026-10-11 12:14:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T12:14:57Z.


@adriadam10 thanks, I'll rebase tonight once main is quiet: one refresh-per-use mechanism shared with main's depth-copy API, DepthSurfaceHolds documented for the per-use DepthPlaneCopy textures, the RefreshedPerUse() check added to the new early return in noteReusable, the three tests rerun, and Closes #1409 in the description.

@ThatsLeo thanks, that's the right shape for the stencil plane. Please open it as its own PR on top of this one once it's on main, with the test for both planes you offered. Stray is good evidence for it.

@xXPBSXx thanks for both runs. Dword 3 0x91b00fac has type field 0x9 in bits 31:28, which is an image (T#) where the shader expects a buffer, so it's a different problem from this PR. Could you open an issue for it with that descriptor and the program address?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108911550 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6108911550). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T12:14:57Z. --- @adriadam10 thanks, I'll rebase tonight once main is quiet: one refresh-per-use mechanism shared with main's depth-copy API, `DepthSurfaceHolds` documented for the per-use `DepthPlaneCopy` textures, the `RefreshedPerUse()` check added to the new early return in `noteReusable`, the three tests rerun, and `Closes #1409` in the description. @ThatsLeo thanks, that's the right shape for the stencil plane. Please open it as its own PR on top of this one once it's on `main`, with the test for both planes you offered. Stray is good evidence for it. @xXPBSXx thanks for both runs. Dword 3 `0x91b00fac` has type field `0x9` in bits 31:28, which is an image (T#) where the shader expects a buffer, so it's a different problem from this PR. Could you open an issue for it with that descriptor and the program address?
merwie commented 2026-10-11 14:17:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-11T14:17:48Z.


A data point from PPSA12544 (Hollow Knight: Silksong), which I listed as needing this PR on #726: on current main (a11c8f7f, Windows 11, RX 9070 XT) the title no longer needs it. With plain main and no other changes, it gets through the first scene where sampling the stencil/depth plane of depth surface ... is not implemented used to stop it, and plays at about 60 fps. That message no longer exists on main. I haven't traced which change covers this title's case; #3277, for Unity reusing a depth surface's memory, looks the most likely. So this PR is no longer needed for this title, though it may still be for titles that sample depth surfaces.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109959175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6109959175). Originally posted by [merwie](https://github.com/merwie) on 2026-10-11T14:17:48Z. --- A data point from PPSA12544 (Hollow Knight: Silksong), which I listed as needing this PR on #726: on current `main` (a11c8f7f, Windows 11, RX 9070 XT) the title no longer needs it. With plain `main` and no other changes, it gets through the first scene where `sampling the stencil/depth plane of depth surface ... is not implemented` used to stop it, and plays at about 60 fps. That message no longer exists on `main`. I haven't traced which change covers this title's case; #3277, for Unity reusing a depth surface's memory, looks the most likely. So this PR is no longer needed for this title, though it may still be for titles that sample depth surfaces.
MichonGoddijn231849 commented 2026-10-11 14:18:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T14:18:26Z.


@adriadam10 rebased on main a11c8f7f7 (6d59983d3). It is now only this PR's four commits; #374's are gone.

  • One refresh-per-use mechanism. Texture has a single PerUseCopy field in place of main's depthCopy bool and this PR's refreshedPerUse bool. It is RefreshedOnReuse for main's depth copy of a storage image, which a reused build brings up to date through RefreshDepthCopy by the image's version, as before. It is RemadePerUse for this PR's depth plane copy, which DepthSurfaceTexture makes again at every use. IsDepthCopy() and RefreshedPerUse() read that field.
  • Plane copies stay out of reuse. I kept them out rather than refreshing them through main's reuse path. A plane copy is rebuilt from the surface list at lookup (slices can be other depth surfaces, or guest memory when none holds them), so refreshing it at revalidation would mean repeating that lookup there.
  • DepthSurfaceHolds returns false for a plane copy. The copy is held by its DepthPlaneCopy, not by the surface, and a build holding one is never reused.
  • noteReusable: the RefreshedPerUse() check is added after main's new early return (HasCopiedWrites() || HoldsLease() || usesBda || ...).
  • Main's stencil-lookup rule (a stencil read must be a 1-byte format, otherwise null) is kept in DepthSurfaceTexture.
  • Closes #1409 is in the description.

On the rebased tree (Windows, RTX 5080): agc_driver_graphics, agc_driver_depth_fast_clear and agc_driver_depth_fast_clear_submit pass, and 373/374 agc_* tests pass. The one failure is agc_driver_emulated_color_compare, where the recompiler refuses an sRGB format this device cannot sample; this PR doesn't touch it. The conventions check passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109964660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6109964660). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T14:18:26Z. --- @adriadam10 rebased on `main` a11c8f7f7 (6d59983d3). It is now only this PR's four commits; #374's are gone. - **One refresh-per-use mechanism.** `Texture` has a single `PerUseCopy` field in place of main's `depthCopy` bool and this PR's `refreshedPerUse` bool. It is `RefreshedOnReuse` for main's depth copy of a storage image, which a reused build brings up to date through `RefreshDepthCopy` by the image's version, as before. It is `RemadePerUse` for this PR's depth plane copy, which `DepthSurfaceTexture` makes again at every use. `IsDepthCopy()` and `RefreshedPerUse()` read that field. - **Plane copies stay out of reuse.** I kept them out rather than refreshing them through main's reuse path. A plane copy is rebuilt from the surface list at lookup (slices can be other depth surfaces, or guest memory when none holds them), so refreshing it at revalidation would mean repeating that lookup there. - **`DepthSurfaceHolds`** returns false for a plane copy. The copy is held by its `DepthPlaneCopy`, not by the surface, and a build holding one is never reused. - **`noteReusable`:** the `RefreshedPerUse()` check is added after main's new early return (`HasCopiedWrites() || HoldsLease() || usesBda || ...`). - **Main's stencil-lookup rule** (a stencil read must be a 1-byte format, otherwise null) is kept in `DepthSurfaceTexture`. - `Closes #1409` is in the description. On the rebased tree (Windows, RTX 5080): `agc_driver_graphics`, `agc_driver_depth_fast_clear` and `agc_driver_depth_fast_clear_submit` pass, and 373/374 `agc_*` tests pass. The one failure is `agc_driver_emulated_color_compare`, where the recompiler refuses an sRGB format this device cannot sample; this PR doesn't touch it. The conventions check passes.
adriadam10 commented 2026-10-11 14:26:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T14:26:49Z.

Review: DISMISSED


Thanks for the rebase. Merged onto current main it builds and libSceAgcDriver ctest passes (384/384). What is left before it can merge:

  • No test. The new paths (2D array / cube / R16_UINT copies in DepthPlaneCopy, SeedStorageFromDepth / TakeWrites round trip, the stencil-plane throw in ShaderResources.cpp, the new storage-format refusal in Transfer) are only exercised by titles, which CI cannot run. Please add execution tests next to the existing agc_driver_* ones, with values pinned: write known depth values, sample them as an array slice / cube face / R16_UINT, and write through a storage image then read the depth back. Include a refusal case (other-format storage over a depth surface still throws).
  • docs/dev/TechnicalDebt.md has no line for this PR. Please record: the plane copy is re-made at every use (no cache), what remains refused (stencil plane as storage, mips, other layouts), and that the copy/transfer layouts are inferred, not measured on hardware.
  • PR description: add Closes #1409 (you mentioned it in the thread).
  • docs/dev/ARCHITECTURE.md: add a short note on the per-use depth plane copy and the seed / take-back between depth surfaces and storage images, under the section describing depth surfaces.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5483662255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#pullrequestreview-5483662255). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T14:26:49Z. **Review:** DISMISSED --- Thanks for the rebase. Merged onto current `main` it builds and `libSceAgcDriver` ctest passes (384/384). What is left before it can merge: - **No test.** The new paths (2D array / cube / `R16_UINT` copies in `DepthPlaneCopy`, `SeedStorageFromDepth` / `TakeWrites` round trip, the stencil-plane throw in `ShaderResources.cpp`, the new storage-format refusal in `Transfer`) are only exercised by titles, which CI cannot run. Please add execution tests next to the existing `agc_driver_*` ones, with values pinned: write known depth values, sample them as an array slice / cube face / `R16_UINT`, and write through a storage image then read the depth back. Include a refusal case (other-format storage over a depth surface still throws). - **`docs/dev/TechnicalDebt.md`** has no line for this PR. Please record: the plane copy is re-made at every use (no cache), what remains refused (stencil plane as storage, mips, other layouts), and that the copy/transfer layouts are inferred, not measured on hardware. - **PR description**: add `Closes #1409` (you mentioned it in the thread). - **`docs/dev/ARCHITECTURE.md`**: add a short note on the per-use depth plane copy and the seed / take-back between depth surfaces and storage images, under the section describing depth surfaces.
xXPBSXx commented 2026-10-11 15:45:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T15:45:40Z.


@MichonGoddijn231849 the issue you asked for is #3709 (descriptor, program address, and what the submission looks like). Short version: the four dwords are the start of a complete 1920x1080 2D T# in COMPUTE_USER_DATA_0..7, and the dispatch runs against the 0x1417c4300 fill kernel because no shader load precedes it in its submission, so it is not caused by this PR. Ad Infinitum's stencil-plane stop is as you described and is untouched by anything I found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110753471 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6110753471). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T15:45:40Z. --- @MichonGoddijn231849 the issue you asked for is #3709 (descriptor, program address, and what the submission looks like). Short version: the four dwords are the start of a complete 1920x1080 2D T# in `COMPUTE_USER_DATA_0..7`, and the dispatch runs against the `0x1417c4300` fill kernel because no shader load precedes it in its submission, so it is not caused by this PR. Ad Infinitum's stencil-plane stop is as you described and is untouched by anything I found. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 17:05:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:05:19Z.


Note from merging #419 and this PR (6d59983d3) on top of main a11c8f7f7 for a test: two textual conflicts, both easy and both mine to guess at, so please check them: (1) cachedStorageTexture in ShaderResources.cpp: #419 adds RequireNoMultisampleTarget(...) as the first line, this PR replaces the depth throw below it; I kept the #419 line and this PR's body. (2) the depth image usage in DepthSurface.cpp: #419 makes SAMPLED conditional on samples == 1, this PR adds TRANSFER_SRC; I used ATTACHMENT | TRANSFER_SRC | TRANSFER_DST | (samples == 1 ? SAMPLED : 0). Both build (relinker and libs); I did not run the PR tests or a title on this combination (the title runs are on #419).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111496301 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6111496301). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T17:05:19Z. --- Note from merging #419 and this PR (6d59983d3) on top of `main` a11c8f7f7 for a test: two textual conflicts, both easy and both mine to guess at, so please check them: (1) `cachedStorageTexture` in `ShaderResources.cpp`: #419 adds `RequireNoMultisampleTarget(...)` as the first line, this PR replaces the depth `throw` below it; I kept the #419 line and this PR's body. (2) the depth image `usage` in `DepthSurface.cpp`: #419 makes `SAMPLED` conditional on `samples == 1`, this PR adds `TRANSFER_SRC`; I used `ATTACHMENT | TRANSFER_SRC | TRANSFER_DST | (samples == 1 ? SAMPLED : 0)`. Both build (`relinker` and `libs`); I did not run the PR tests or a title on this combination (the title runs are on #419). AI-assisted (Claude Code).
Kikoarl commented 2026-10-11 18:32:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-11T18:32:01Z.


Hi @MichonGoddijn231849, @adriadam10!

Following up on the review feedback regarding execution tests, documentation, and generalized format support:

We tested this implementation on real hardware (Linux CachyOS, RTX 5060 Ti, driver 615.78, Vulkan 1.4) against Astro Bot (PPSA21567) and implemented the requested additions:

  1. Format 122 (FormatR11G11B10Float / B10G11R11) Support:
    • In DepthSurface::Transfer, Astro Bot binds 1080p post-processing textures using format 36 (FormatR11G11B10Float, Vulkan 122).
    • Generalized sized checking via BlockWidth(descriptor.format) == 1u && elementBytes == (d16 ? 2u : 4u) so multi-channel 4-byte packed formats are accepted without manual enum listing.
  2. Real-Hardware Execution Tests (tests/execution/DepthSurfaceStorage.cpp):
    • Added agc_driver_depth_surface_storage_tests:
      • Depth draw initialization & render extent verification.
      • Incompatible storage format rejection (asserting expected exception).
      • Format 122 storage transfer verification.
      • Stencil plane storage rejection.
    • Result: 5/5 execution tests pass (100%) on real NVIDIA hardware; agc_driver_graphics passes.
  3. Unit Tests Added (tests/DepthSurfaceReuse.cpp):
    • 2D array and Cubemap depth plane copy texture refresh checks.
    • Non-depth swizzle R16_UINT on D16 depth plane copy.
    • Stencil plane identification (DepthStencilPlaneAt).
  4. Documentation:
    • Added ### Depth surfaces architecture section in docs/dev/ARCHITECTURE.md.
    • Added tracking debt entry in docs/dev/TechnicalDebt.md.
  5. Empirical Game Verification:
    • Astro Bot boots and runs its full 3D title sequence (title_controller_ship, animated 3D letters, lighting and cosmic nebula) actively sampling format 122 depth storage transfers.

If helpful, the commit is clean, passes tools/check_conventions.py --base 6d59983d3 with zero errors, and is available for cherry-picking:
Branch: feat/pr-425-execution-tests on fork https://github.com/Kikoarl/AnyPS5.git (commit 34dd36000).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112288633 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6112288633). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-11T18:32:01Z. --- Hi @MichonGoddijn231849, @adriadam10! Following up on the review feedback regarding execution tests, documentation, and generalized format support: We tested this implementation on real hardware (Linux CachyOS, RTX 5060 Ti, driver 615.78, Vulkan 1.4) against **Astro Bot** (*PPSA21567*) and implemented the requested additions: 1. **Format 122 (`FormatR11G11B10Float` / `B10G11R11`) Support:** - In `DepthSurface::Transfer`, Astro Bot binds 1080p post-processing textures using format 36 (`FormatR11G11B10Float`, Vulkan 122). - Generalized `sized` checking via `BlockWidth(descriptor.format) == 1u && elementBytes == (d16 ? 2u : 4u)` so multi-channel 4-byte packed formats are accepted without manual enum listing. 2. **Real-Hardware Execution Tests (`tests/execution/DepthSurfaceStorage.cpp`):** - Added `agc_driver_depth_surface_storage_tests`: * Depth draw initialization & render extent verification. * Incompatible storage format rejection (asserting expected exception). * Format 122 storage transfer verification. * Stencil plane storage rejection. - Result: **5/5 execution tests pass (100%)** on real NVIDIA hardware; `agc_driver_graphics` passes. 3. **Unit Tests Added (`tests/DepthSurfaceReuse.cpp`):** - 2D array and Cubemap depth plane copy texture refresh checks. - Non-depth swizzle `R16_UINT` on D16 depth plane copy. - Stencil plane identification (`DepthStencilPlaneAt`). 4. **Documentation:** - Added `### Depth surfaces` architecture section in `docs/dev/ARCHITECTURE.md`. - Added tracking debt entry in `docs/dev/TechnicalDebt.md`. 5. **Empirical Game Verification:** - Astro Bot boots and runs its full 3D title sequence (`title_controller_ship`, animated 3D letters, lighting and cosmic nebula) actively sampling format 122 depth storage transfers. If helpful, the commit is clean, passes `tools/check_conventions.py --base 6d59983d3` with zero errors, and is available for cherry-picking: Branch: `feat/pr-425-execution-tests` on fork `https://github.com/Kikoarl/AnyPS5.git` (commit `34dd36000`).
xXPBSXx commented 2026-10-11 19:39:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T19:39:22Z.


Ad Infinitum (PPSA10600), Windows, main a11c8f7f7 + this PR at 6d59983d3 (clean merge, no conflicts), built with relinker and libs. A 60 s run is still compiling shaders and shows no stop; with the shader cache warm, a 90 s run stops with:

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

So the storage image access to depth/stencil surface 0x20c41f0000 is not implemented error from #1409 is gone with this PR, and the next stop is the stencil plane this PR deliberately still refuses (cachedStorageTexture, Require(!DepthStencilPlaneAt(...))), which Michon said ThatsLeo will do as a follow-up. Nothing else in the log before it. I did not look at the image and did not run Palworld or PPSA25936.

State of the PR on my side: it merges cleanly onto main a11c8f7f7 after the rebase; the earlier conflicts with #419 are in my note above.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112935901 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6112935901). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T19:39:22Z. --- Ad Infinitum (PPSA10600), Windows, `main` a11c8f7f7 + this PR at 6d59983d3 (clean merge, no conflicts), built with `relinker` and `libs`. A 60 s run is still compiling shaders and shows no stop; with the shader cache warm, a 90 s run stops with: ``` compute shader 0x200ac30000: AGC graphics: storage access to a depth surface's stencil plane is not implemented ``` So the `storage image access to depth/stencil surface 0x20c41f0000 is not implemented` error from #1409 is gone with this PR, and the next stop is the stencil plane this PR deliberately still refuses (`cachedStorageTexture`, `Require(!DepthStencilPlaneAt(...))`), which Michon said ThatsLeo will do as a follow-up. Nothing else in the log before it. I did not look at the image and did not run Palworld or PPSA25936. State of the PR on my side: it merges cleanly onto `main` a11c8f7f7 after the rebase; the earlier conflicts with #419 are in my note above. AI-assisted (Claude Code).
fma-rc commented 2026-10-11 19:50:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-11T19:50:58Z.


Astro's Playroom (PPSA01325) on Linux, RTX 5080, main a11c8f7f7 with this PR at 6d59983d3 (plus PRs 3669, 3750 and 3878, which the title needs to get this far): the layered depth views work and the title gets past its sampling the depth plane of depth surface ... as a 2048x2048 texture stop to the menu and into its first 3D scene. That scene runs at about 1 fps, and a perf sample puts 66% of the process in DepthPlaneCopy::Refresh under resolveImageBinding.

DepthSurfaceTexture calls Refresh on every lookup of a layered view, so each draw that binds one redoes the whole copy. The scene binds a 16-slice 1024x1024 D32 array of which 3 slices are live depth surfaces, so every refresh reads the other 13 layers from guest memory (52 MiB) and detiles them. I counted 170 to 250 refreshes and 1100 to 1600 guest layer reads per second, 4 to 6 GiB/s of memcpy.

A throwaway change that skips a repeat refresh of the same copy within one second took the scene from 0.6-1.1 fps to 4.4-7 fps.

Edit: I wrote a change check as one commit on top of 6d59983d3, in case it is useful: github.com/fma-rc/AnyPS5@d0ca857225. Each depth surface gets a write generation (set when it is bound as a depth target, fast-cleared or written back from a storage image), guest layers are compared through the write tracker, and only the layers that changed are copied. With it the scene runs at 4 to 9 fps with its shadows drawn and DepthPlaneCopy::Refresh is gone from the profile. It has no test, and the part I am least sure of is skipping the guest-memory check while CollectEpoch and TrackerGeneration have not moved.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113043656 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6113043656). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-11T19:50:58Z. --- Astro's Playroom (PPSA01325) on Linux, RTX 5080, `main` a11c8f7f7 with this PR at 6d59983d3 (plus PRs 3669, 3750 and 3878, which the title needs to get this far): the layered depth views work and the title gets past its `sampling the depth plane of depth surface ... as a 2048x2048 texture` stop to the menu and into its first 3D scene. That scene runs at about 1 fps, and a perf sample puts 66% of the process in `DepthPlaneCopy::Refresh` under `resolveImageBinding`. `DepthSurfaceTexture` calls `Refresh` on every lookup of a layered view, so each draw that binds one redoes the whole copy. The scene binds a 16-slice 1024x1024 D32 array of which 3 slices are live depth surfaces, so every refresh reads the other 13 layers from guest memory (52 MiB) and detiles them. I counted 170 to 250 refreshes and 1100 to 1600 guest layer reads per second, 4 to 6 GiB/s of memcpy. A throwaway change that skips a repeat refresh of the same copy within one second took the scene from 0.6-1.1 fps to 4.4-7 fps. Edit: I wrote a change check as one commit on top of 6d59983d3, in case it is useful: https://github.com/fma-rc/AnyPS5/commit/d0ca8572259752bf63fd8c4998fd2c16d628ec6f. Each depth surface gets a write generation (set when it is bound as a depth target, fast-cleared or written back from a storage image), guest layers are compared through the write tracker, and only the layers that changed are copied. With it the scene runs at 4 to 9 fps with its shadows drawn and `DepthPlaneCopy::Refresh` is gone from the profile. It has no test, and the part I am least sure of is skipping the guest-memory check while `CollectEpoch` and `TrackerGeneration` have not moved.
xXPBSXx commented 2026-10-11 20:23:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:23:58Z.


@MichonGoddijn231849 where Ad Infinitum (PPSA10600) stops after this PR (main a11c8f7f7 + 6d59983d3): compute shader 0x200ac30000: ... storage access to a depth surface's stencil plane is not implemented, thrown at ShaderResources.cpp:836 (Require(!DepthStencilPlaneAt(viewed.baseAddress), ...) in cachedStorageTexture; DepthSurface.cpp:553 defines the predicate as stencilAddress == address && address != target.address). Reading the diff, what a stencil storage path would have to change, as far as I can see (I have not written it):

  • SeedStorageFromDepth (DepthSurface.cpp:486) looks the surface up by surface->target.address == descriptor.baseAddress only; for the plane it would need target.stencilAddress.
  • DepthSurface::Transfer (DepthSurface.cpp:131) hard-codes VK_IMAGE_ASPECT_DEPTH_BIT for the image-to-buffer copy, a 2- or 4-byte element (d16 ? 2u : 4u) for the staging buffer, and accepts only R16/R32 storage formats; a stencil plane is 1 byte per element and would need VK_IMAGE_ASPECT_STENCIL_BIT and an R8 storage format.
  • The sampled path already distinguishes the plane (stencil = target.stencilAddress != 0 && resource.baseAddress == target.stencilAddress, VK_FORMAT_R8_UINT, DepthSurface.cpp:104-118 and :449-455), so the plane's format and address handling exist there.

All line numbers are from 6d59983d3. This is a reading of the code, not a run of a stencil path.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113357770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6113357770). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T20:23:58Z. --- @MichonGoddijn231849 where Ad Infinitum (PPSA10600) stops after this PR (`main` a11c8f7f7 + 6d59983d3): `compute shader 0x200ac30000: ... storage access to a depth surface's stencil plane is not implemented`, thrown at `ShaderResources.cpp:836` (`Require(!DepthStencilPlaneAt(viewed.baseAddress), ...)` in `cachedStorageTexture`; `DepthSurface.cpp:553` defines the predicate as `stencilAddress == address && address != target.address`). Reading the diff, what a stencil storage path would have to change, as far as I can see (I have not written it): - `SeedStorageFromDepth` (`DepthSurface.cpp:486`) looks the surface up by `surface->target.address == descriptor.baseAddress` only; for the plane it would need `target.stencilAddress`. - `DepthSurface::Transfer` (`DepthSurface.cpp:131`) hard-codes `VK_IMAGE_ASPECT_DEPTH_BIT` for the image-to-buffer copy, a 2- or 4-byte element (`d16 ? 2u : 4u`) for the staging buffer, and accepts only R16/R32 storage formats; a stencil plane is 1 byte per element and would need `VK_IMAGE_ASPECT_STENCIL_BIT` and an R8 storage format. - The sampled path already distinguishes the plane (`stencil = target.stencilAddress != 0 && resource.baseAddress == target.stencilAddress`, `VK_FORMAT_R8_UINT`, `DepthSurface.cpp:104-118` and `:449-455`), so the plane's format and address handling exist there. All line numbers are from 6d59983d3. This is a reading of the code, not a run of a stencil path. AI-assisted (Claude Code).
ThatsLeo commented 2026-10-11 20:47:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T20:47:39Z.


@xXPBSXx @MichonGoddijn231849 the stencil follow-up is ready on top of this PR's current head: ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage-v2 (one commit, d3599578, on 6d59983d). I'll open it as its own PR once this one is merged.

It makes the three changes your reading lists: SeedStorageFromDepth also matches target.stencilAddress, and Transfer copies the stencil aspect through a 1-byte-per-texel buffer into R8 storage. It also removes the DepthStencilPlaneAt refusal in cachedStorageTexture. A storage image over the stencil plane then takes the plane's bits as R8, the way the depth plane does as R16/R32. Each plane has its own writer, and the surface takes both back at its next use.

The new test, agc_driver_depth_stencil_storage, works on a D32S8 surface:

  1. A draw writes depth 0.5 and stencil 1.
  2. Two compute dispatches write the first 32 texels through storage images, R32 over the depth plane and R8 over the stencil plane.
  3. Three draws check the result:
    • the stencil test passes exactly the 32 written texels;
    • it leaves the others at 1;
    • a depth test passes exactly the 32 texels written through the depth plane.

On this PR's head without the commit, the test fails with storage access to a depth surface's stencil plane is not implemented. That is the stop in Ad Infinitum. The full suite on Intel Arc (Mesa 26.2.3 ANV) and lavapipe shows the same failures as main (agc_driver_emulated_color_compare and agc_driver_vop1_float_unary on Arc; agc_driver_emulated_color_compare and agc_driver_image_plane_address_on_line_implicit_lod on lavapipe).

@xXPBSXx if you can run Ad Infinitum with it on top, that would tell whether 0x200ac30000 gets further.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113583933 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6113583933). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T20:47:39Z. --- @xXPBSXx @MichonGoddijn231849 the stencil follow-up is ready on top of this PR's current head: [`ThatsLeo/AnyPS5:feat/agc-depth-stencil-storage-v2`](https://github.com/ThatsLeo/AnyPS5/tree/feat/agc-depth-stencil-storage-v2) (one commit, `d3599578`, on `6d59983d`). I'll open it as its own PR once this one is merged. It makes the three changes your reading lists: `SeedStorageFromDepth` also matches `target.stencilAddress`, and `Transfer` copies the stencil aspect through a 1-byte-per-texel buffer into R8 storage. It also removes the `DepthStencilPlaneAt` refusal in `cachedStorageTexture`. A storage image over the stencil plane then takes the plane's bits as R8, the way the depth plane does as R16/R32. Each plane has its own writer, and the surface takes both back at its next use. The new test, `agc_driver_depth_stencil_storage`, works on a D32S8 surface: 1. A draw writes depth 0.5 and stencil 1. 2. Two compute dispatches write the first 32 texels through storage images, R32 over the depth plane and R8 over the stencil plane. 3. Three draws check the result: - the stencil test passes exactly the 32 written texels; - it leaves the others at 1; - a depth test passes exactly the 32 texels written through the depth plane. On this PR's head without the commit, the test fails with `storage access to a depth surface's stencil plane is not implemented`. That is the stop in Ad Infinitum. The full suite on Intel Arc (Mesa 26.2.3 ANV) and lavapipe shows the same failures as `main` (`agc_driver_emulated_color_compare` and `agc_driver_vop1_float_unary` on Arc; `agc_driver_emulated_color_compare` and `agc_driver_image_plane_address_on_line_implicit_lod` on lavapipe). @xXPBSXx if you can run Ad Infinitum with it on top, that would tell whether `0x200ac30000` gets further. AI-assisted: yes.
MichonGoddijn231849 commented 2026-10-11 22:14:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T22:14:59Z.


Rebased on current main (acc5d2949, with #419 merged), head f470ffaa2. The two conflicts are the ones @xXPBSXx described, resolved the same way:

  • cachedStorageTexture keeps #419's RequireNoMultisampleTarget first, then this PR's seed / take-back body.
  • The depth image usage is DEPTH_STENCIL_ATTACHMENT | TRANSFER_SRC | TRANSFER_DST | (samples == 1 ? SAMPLED : 0).

The combination also needed one addition: a multisampled depth surface can't go through the image-to-buffer copy of the storage path, so Transfer now refuses it (storage image access to a multisampled depth surface is not implemented), as sampling already does. agc_driver_graphics and the depth tests (depth_fast_clear(_submit), depth_bias_per_face, depth_compare_copy, pending_exact_surface) pass, and so does check_conventions.py.

@Kikoarl thanks for working on the tests. Three things keep me from taking 34dd36000 as it is:

  • tests/execution/DepthSurfaceStorage.cpp isn't registered in libSceAgcDriver/CMakeLists.txt, so CI never builds or runs it.
  • The review asks for pinned values: known depth sampled back as an array slice, a cube face and R16_UINT, and the depth read back after a storage write. The test checks the two refusals and that a format-36 dispatch doesn't throw, but nothing reads a value back.
  • The sized check now accepts any 4-byte single-block format (R11G11B10, RGBA8, ...) over a D32 surface. A post-processing texture at a depth surface's address in Astro Bot is more likely the title reusing that memory than a storage view of the live depth surface, and seeding it from the depth plane would then give it depth bits. That change needs its own case, next to main's reused-memory rule (a view of another extent or format is not the surface).

If you'd like to update the branch along those lines, I'll take it in with you as the author. Otherwise I'll write the tests here.

@fma-rc thanks, the per-use refresh is the known cost (TechnicalDebt will say the copy is re-made at every use), and your write-generation approach is the right fix. Please open it as its own PR on top once this one is merged, with a test: an unchanged layer is not copied again, and a changed one is.

@ThatsLeo thanks, that's the stencil path the refusal was waiting for. Opening it once this lands works for me.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114461675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6114461675). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T22:14:59Z. --- Rebased on current `main` (`acc5d2949`, with #419 merged), head `f470ffaa2`. The two conflicts are the ones @xXPBSXx described, resolved the same way: - `cachedStorageTexture` keeps #419's `RequireNoMultisampleTarget` first, then this PR's seed / take-back body. - The depth image usage is `DEPTH_STENCIL_ATTACHMENT | TRANSFER_SRC | TRANSFER_DST | (samples == 1 ? SAMPLED : 0)`. The combination also needed one addition: a multisampled depth surface can't go through the image-to-buffer copy of the storage path, so `Transfer` now refuses it (`storage image access to a multisampled depth surface is not implemented`), as sampling already does. `agc_driver_graphics` and the depth tests (`depth_fast_clear(_submit)`, `depth_bias_per_face`, `depth_compare_copy`, `pending_exact_surface`) pass, and so does `check_conventions.py`. @Kikoarl thanks for working on the tests. Three things keep me from taking `34dd36000` as it is: - `tests/execution/DepthSurfaceStorage.cpp` isn't registered in `libSceAgcDriver/CMakeLists.txt`, so CI never builds or runs it. - The review asks for pinned values: known depth sampled back as an array slice, a cube face and `R16_UINT`, and the depth read back after a storage write. The test checks the two refusals and that a format-36 dispatch doesn't throw, but nothing reads a value back. - The `sized` check now accepts any 4-byte single-block format (R11G11B10, RGBA8, ...) over a D32 surface. A post-processing texture at a depth surface's address in Astro Bot is more likely the title reusing that memory than a storage view of the live depth surface, and seeding it from the depth plane would then give it depth bits. That change needs its own case, next to main's reused-memory rule (a view of another extent or format is not the surface). If you'd like to update the branch along those lines, I'll take it in with you as the author. Otherwise I'll write the tests here. @fma-rc thanks, the per-use refresh is the known cost (TechnicalDebt will say the copy is re-made at every use), and your write-generation approach is the right fix. Please open it as its own PR on top once this one is merged, with a test: an unchanged layer is not copied again, and a changed one is. @ThatsLeo thanks, that's the stencil path the refusal was waiting for. Opening it once this lands works for me.
fdfawef324 commented 2026-10-11 22:15:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-11T22:15:26Z.


Data point from Demon's Souls (PPSA01342 v1.005, US) on Windows 11 / Server 2025, RTX 3060 (NVIDIA 591.86), MinGW-w64 GCC 15.2.0, Release.

Tree: main a11c8f7f7 + #3871 + a local fix for a resummarize draw (not yet a PR) + this PR at 6d59983d3 + #2904 at 4fdbe916e. The two conflict only in cachedStorageTexture; I resolved it as queeeef did above (kept this PR's body, and seed from depth only when #2904's DepthSurfaceAt(context, words, viewed) matches).

Without them, the title stops at the PlayStation Studios logo:

[videoout] presentation failed: compute shader 0x24893fb00: AGC graphics: storage image access to depth/stencil surface 0x282e10000 is not implemented

With both, that stop is gone in all seven runs: the logo plays, then the language select, brightness calibration and voice/subtitle screens (input through APS5_PAD_INPUT_FILE), and the opening cinematic starts. Neither the stencil-plane refusal nor the storage-format refusal appeared. The next stop is a bindless table (#757's area):

[videoout] presentation failed: compute shader 0x248947300: bindless image table: 18 distinct keys exceed the 16 slots

I did not run this PR without #2904, so I can't say which of the two this title needs on its own; ponhei9502's PPSA01341 report above points at #2904's reused-memory case.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114467302 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6114467302). Originally posted by [fdfawef324](https://github.com/fdfawef324) on 2026-10-11T22:15:26Z. --- Data point from Demon's Souls (PPSA01342 v1.005, US) on Windows 11 / Server 2025, RTX 3060 (NVIDIA 591.86), MinGW-w64 GCC 15.2.0, Release. Tree: `main` a11c8f7f7 + #3871 + a local fix for a resummarize draw (not yet a PR) + this PR at `6d59983d3` + #2904 at `4fdbe916e`. The two conflict only in `cachedStorageTexture`; I resolved it as queeeef did above (kept this PR's body, and seed from depth only when #2904's `DepthSurfaceAt(context, words, viewed)` matches). Without them, the title stops at the PlayStation Studios logo: ``` [videoout] presentation failed: compute shader 0x24893fb00: AGC graphics: storage image access to depth/stencil surface 0x282e10000 is not implemented ``` With both, that stop is gone in all seven runs: the logo plays, then the language select, brightness calibration and voice/subtitle screens (input through `APS5_PAD_INPUT_FILE`), and the opening cinematic starts. Neither the stencil-plane refusal nor the storage-format refusal appeared. The next stop is a bindless table (#757's area): ``` [videoout] presentation failed: compute shader 0x248947300: bindless image table: 18 distinct keys exceed the 16 slots ``` I did not run this PR without #2904, so I can't say which of the two this title needs on its own; ponhei9502's PPSA01341 report above points at #2904's reused-memory case. AI-assisted: yes (Claude Code)
tibzejoker commented 2026-10-11 23:52:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-11T23:52:05Z.


GTA V (PPSA04264) data point for this PR, on current main (325e0a8bd) with this PR at f470ffaa2 merged, Windows 11, RTX 4090.

In Story mode, compute shader 0x242d4a200 samples a D16 depth surface's planes as a 2D array whose T# reads the raw depth bits as an integer format, and the layered path refuses it:

compute shader 0x242d4a200: AGC graphics: sampling the depth planes of depth surface 0x2970a0000 (512x512, vk format 124) as a 512x512 texture of guest format 11 (vk 74), dimension 2, 6 slices, levels 0-0, base slice 0 is not implemented

The T# is flagged as depth bits (DepthBitsTextureWidth == 16), so integer is false, copyFormat becomes R16_UNORM, and the requested R16_UINT no longer matches. Reading D16 depth bits as R16_UINT is the same copy as the integer case, so routing it through the existing integer plane copy is enough:

-    const auto copyFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT;
+    const bool d16Bits = d16 && depthBits && format == VK_FORMAT_R16_UINT;
+    const auto copyFormat = integer || d16Bits ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT;
 ...
-    const auto imageFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_D16_UNORM : VK_FORMAT_D32_SFLOAT;
+    const auto imageFormat = integer || d16Bits ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_D16_UNORM : VK_FORMAT_D32_SFLOAT;

With that, GTA gets past this dispatch and stops later on an unrelated clip-distance export (#423). I have not checked the sampled values against hardware, only that the game goes on. Feel free to take the change or do it differently; I did not want to open a competing PR on top of yours.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115297597 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6115297597). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-11T23:52:05Z. --- GTA V (PPSA04264) data point for this PR, on current `main` (325e0a8bd) with this PR at f470ffaa2 merged, Windows 11, RTX 4090. In Story mode, compute shader `0x242d4a200` samples a D16 depth surface's planes as a 2D array whose T# reads the raw depth bits as an integer format, and the layered path refuses it: ``` compute shader 0x242d4a200: AGC graphics: sampling the depth planes of depth surface 0x2970a0000 (512x512, vk format 124) as a 512x512 texture of guest format 11 (vk 74), dimension 2, 6 slices, levels 0-0, base slice 0 is not implemented ``` The T# is flagged as depth bits (`DepthBitsTextureWidth == 16`), so `integer` is false, `copyFormat` becomes `R16_UNORM`, and the requested `R16_UINT` no longer matches. Reading D16 depth bits as `R16_UINT` is the same copy as the integer case, so routing it through the existing integer plane copy is enough: ```diff - const auto copyFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT; + const bool d16Bits = d16 && depthBits && format == VK_FORMAT_R16_UINT; + const auto copyFormat = integer || d16Bits ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT; ... - const auto imageFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_D16_UNORM : VK_FORMAT_D32_SFLOAT; + const auto imageFormat = integer || d16Bits ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_D16_UNORM : VK_FORMAT_D32_SFLOAT; ``` With that, GTA gets past this dispatch and stops later on an unrelated clip-distance export (#423). I have not checked the sampled values against hardware, only that the game goes on. Feel free to take the change or do it differently; I did not want to open a competing PR on top of yours. AI-assisted (Claude Code).
Kikoarl commented 2026-10-12 00:10:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-12T00:10:07Z.


Hi @MichonGoddijn231849,

Thanks for the detailed follow-up and analysis!

  1. Reused-memory rule vs format 36 (R11G11B10):
    You are completely right. What Astro Bot does at that address is title memory reuse for post-processing rather than an active depth-plane view. Your approach in f470ffaa2 (returning nullptr for unrelated formats so the normal storage/texture path takes it as reused memory) is much cleaner and avoids accidentally seeding depth bits into post-processing buffers.

  2. Tests with pinned values & CI registration:
    Agree 100% — placing the tests directly in tests/DepthSurfaceReuse.cpp (which CI already builds and executes via agc_driver_depth_surface_reuse_tests) with concrete pinned values for array slices, cubemap faces and R16_UINT round-trips is much more maintainable than a standalone test file.

Please feel free to write or adapt the tests directly in #425 as you see fit. Glad the empirical run on Astro Bot helped validate the interaction and conflict resolution. Looking forward to seeing #425 merged!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115444210 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6115444210). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-12T00:10:07Z. --- Hi @MichonGoddijn231849, Thanks for the detailed follow-up and analysis! 1. **Reused-memory rule vs format 36 (`R11G11B10`):** You are completely right. What Astro Bot does at that address is title memory reuse for post-processing rather than an active depth-plane view. Your approach in `f470ffaa2` (returning `nullptr` for unrelated formats so the normal storage/texture path takes it as reused memory) is much cleaner and avoids accidentally seeding depth bits into post-processing buffers. 2. **Tests with pinned values & CI registration:** Agree 100% — placing the tests directly in `tests/DepthSurfaceReuse.cpp` (which CI already builds and executes via `agc_driver_depth_surface_reuse_tests`) with concrete pinned values for array slices, cubemap faces and `R16_UINT` round-trips is much more maintainable than a standalone test file. Please feel free to write or adapt the tests directly in #425 as you see fit. Glad the empirical run on Astro Bot helped validate the interaction and conflict resolution. Looking forward to seeing #425 merged!
xXPBSXx commented 2026-10-12 06:49:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T06:49:58Z.


@MichonGoddijn231849 a short check from my side, since this PR is the one that most stops go through: I merged f470ffaa2 onto current main (d06c06565) just now and it merges without conflicts (4 commits, your authorship intact); a build of that merge is running here. From your last comment the open items on this PR are the pinned-value execution tests (known depth sampled as an array slice, a cube face and R16_UINT, and the depth read back after a storage write, plus the refusal case), the TechnicalDebt entry and the ARCHITECTURE.md note. If it helps, I can write the execution test along the lines of the review and push it to a branch on my fork for you to take in as you like (you stay the author of your commits, the test would be a separate commit by me), or hand over run results from titles. If you would rather write the tests yourself, say so and I will not duplicate it. I will report the next stops after your PR on Ad Infinitum and Puyo Puyo Tetris 2 here once my build finishes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119241064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6119241064). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T06:49:58Z. --- @MichonGoddijn231849 a short check from my side, since this PR is the one that most stops go through: I merged `f470ffaa2` onto current `main` (`d06c06565`) just now and it merges without conflicts (4 commits, your authorship intact); a build of that merge is running here. From your last comment the open items on this PR are the pinned-value execution tests (known depth sampled as an array slice, a cube face and `R16_UINT`, and the depth read back after a storage write, plus the refusal case), the TechnicalDebt entry and the `ARCHITECTURE.md` note. If it helps, I can write the execution test along the lines of the review and push it to a branch on my fork for you to take in as you like (you stay the author of your commits, the test would be a separate commit by me), or hand over run results from titles. If you would rather write the tests yourself, say so and I will not duplicate it. I will report the next stops after your PR on Ad Infinitum and Puyo Puyo Tetris 2 here once my build finishes. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 10:40:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T10:40:57Z.


Windows test of this PR (head f470ffaa2) merged onto main 9aa5fd290 (clean merge, merge commit f26daace4 on my fork): MinGW-w64 GCC, Release, RTX 4080 SUPER (NVIDIA driver). Built agc_driver_graphics_tests, agc_driver_depth_bias_per_face_tests, agc_driver_depth_compare_copy_tests, agc_driver_depth_fast_clear_tests, agc_driver_depth_fast_clear_submit_tests and agc_driver_pending_exact_surface_tests; ctest -R "agc_driver_(depth|graphics$|pending_exact)": 6/6 passed (15.6 s). This is the existing coverage; there is no test yet for the new depth plane copy, seed and take-back paths (the review's open point), so a pass here does not exercise them. Titles on the same tree: Ad Infinitum and Puyo Puyo Tetris 2 get past the depth-storage error (results on #1409).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6122635919 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6122635919). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T10:40:57Z. --- Windows test of this PR (head `f470ffaa2`) merged onto `main` 9aa5fd290 (clean merge, merge commit `f26daace4` on my fork): MinGW-w64 GCC, Release, RTX 4080 SUPER (NVIDIA driver). Built `agc_driver_graphics_tests`, `agc_driver_depth_bias_per_face_tests`, `agc_driver_depth_compare_copy_tests`, `agc_driver_depth_fast_clear_tests`, `agc_driver_depth_fast_clear_submit_tests` and `agc_driver_pending_exact_surface_tests`; `ctest -R "agc_driver_(depth|graphics$|pending_exact)"`: **6/6 passed** (15.6 s). This is the existing coverage; there is no test yet for the new depth plane copy, seed and take-back paths (the review's open point), so a pass here does not exercise them. Titles on the same tree: Ad Infinitum and Puyo Puyo Tetris 2 get past the depth-storage error (results on #1409). AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 12:37:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:37:02Z.


Rebase hint: against current main (c5675762a) this PR has exactly one conflict, in core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (cachedStorageTexture). Main now throws "storage image access to depth/stencil surface ... is not implemented" via DepthSurfaceAt(context, words, viewed) right at that spot; this PR replaces that throw with the stencil-plane Require, lookupStorageTexture(...) and SeedStorageFromDepth. Resolution: drop main's if (DepthSurfaceAt(...)) { ... throw ... } block and keep this PR's body. Textual merge only, not built or tested after this particular merge (last Windows result: 6/6 ctest on 9aa5fd290 + this PR).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6124396615 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6124396615). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T12:37:02Z. --- Rebase hint: against current main (c5675762a) this PR has exactly one conflict, in `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` (`cachedStorageTexture`). Main now throws "storage image access to depth/stencil surface ... is not implemented" via `DepthSurfaceAt(context, words, viewed)` right at that spot; this PR replaces that throw with the stencil-plane `Require`, `lookupStorageTexture(...)` and `SeedStorageFromDepth`. Resolution: drop main's `if (DepthSurfaceAt(...)) { ... throw ... }` block and keep this PR's body. Textual merge only, not built or tested after this particular merge (last Windows result: 6/6 ctest on 9aa5fd290 + this PR). AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 13:27:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T13:27:28Z.


@MichonGoddijn231849 @Kikoarl a coordination question so we do not write the same test twice. The open review item is the execution test with pinned values (known depth sampled back as an array slice, a cube face and R16_UINT; depth read back after a storage write; the refusal case), registered in libSceAgcDriver/CMakeLists.txt so CI runs it. Is one of you already writing it? If not, I will write it as a separate commit on a branch of my fork (your commits stay as they are, nothing is pushed to your branch) and post the link and the Windows result here, and you can take it in or not. If I hear nothing in about an hour I will start; if you are already on it, say so and I will only run it on Windows and on Ad Infinitum and The Mound.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125235871 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6125235871). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T13:27:28Z. --- @MichonGoddijn231849 @Kikoarl a coordination question so we do not write the same test twice. The open review item is the execution test with pinned values (known depth sampled back as an array slice, a cube face and `R16_UINT`; depth read back after a storage write; the refusal case), registered in `libSceAgcDriver/CMakeLists.txt` so CI runs it. Is one of you already writing it? If not, I will write it as a separate commit on a branch of my fork (your commits stay as they are, nothing is pushed to your branch) and post the link and the Windows result here, and you can take it in or not. If I hear nothing in about an hour I will start; if you are already on it, say so and I will only run it on Windows and on Ad Infinitum and The Mound. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 13:50:19 +00:00 (Migrated from github.com)

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


Finding while preparing the execution test: with this head (f470ffaa2) merged onto current main (c6efe068a), the existing agc_driver_depth_storage_reuse test fails; it passes on plain main (same machine, same build tree, rebuilt both ways).

AGC graphics: storage image access to depth surface 0x7ff64fb6a000 (64x32, vk format 126) as a 32x32 image of vk format 100, dimension 1, 1 mips is not implemented

That test (from #2904) writes depth into a D32 surface of 64x32, then reads the same memory as a 32x32 R32_FLOAT storage image (Read(*device, 22u, Width / 2u, false, 0.25f), the guest bytes must stay 0.25f). The refusal comes from the Transfer check in DepthSurface.cpp that requires the storage image extent to equal the depth target's extent (descriptor.width != target.extent.width || descriptor.height != target.extent.height, line 138 of the head's file): memory that a title reuses as a differently shaped image is now refused instead of reaching the normal storage path that main takes. Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, RTX 4080 SUPER; the other depth tests (depth_fast_clear, depth_fast_clear_submit, depth_bias_per_face, depth_compare_copy, pending_exact_surface, agc_driver_graphics) pass on the same merge. Not checked: Linux, and whether the title cases in #1409 need the stricter check.

So the reused-memory rule from #2904 (an image whose shape differs from the depth target is not a view of the depth target) needs to hold in Transfer too, not only in the format test, and the pinned-value test I am preparing will include this case.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125624406 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6125624406). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T13:50:19Z. --- Finding while preparing the execution test: with this head (`f470ffaa2`) merged onto current `main` (`c6efe068a`), the existing `agc_driver_depth_storage_reuse` test fails; it passes on plain `main` (same machine, same build tree, rebuilt both ways). ``` AGC graphics: storage image access to depth surface 0x7ff64fb6a000 (64x32, vk format 126) as a 32x32 image of vk format 100, dimension 1, 1 mips is not implemented ``` That test (from #2904) writes depth into a D32 surface of 64x32, then reads the same memory as a 32x32 `R32_FLOAT` storage image (`Read(*device, 22u, Width / 2u, false, 0.25f)`, the guest bytes must stay `0.25f`). The refusal comes from the `Transfer` check in `DepthSurface.cpp` that requires the storage image extent to equal the depth target's extent (`descriptor.width != target.extent.width || descriptor.height != target.extent.height`, line 138 of the head's file): memory that a title reuses as a differently shaped image is now refused instead of reaching the normal storage path that `main` takes. Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, RTX 4080 SUPER; the other depth tests (`depth_fast_clear`, `depth_fast_clear_submit`, `depth_bias_per_face`, `depth_compare_copy`, `pending_exact_surface`, `agc_driver_graphics`) pass on the same merge. Not checked: Linux, and whether the title cases in #1409 need the stricter check. So the reused-memory rule from #2904 (an image whose shape differs from the depth target is not a view of the depth target) needs to hold in `Transfer` too, not only in the format test, and the pinned-value test I am preparing will include this case. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 14:51:17 +00:00 (Migrated from github.com)

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


Overlap note: PR #4500 (storage image access to depth surfaces, with its own execution test) was opened after this PR and also targets #1409. It takes a view of another extent or format through the ordinary texture path, which is the case where this PR fails \agc_driver_depth_storage_reuse` on `main` (see the comment above). Both touch `DepthSurface.cpp` and `ShaderResources.cpp` (`cachedStorageTexture`), so they will conflict whichever lands second. I am no longer writing a separate execution test for this PR; the Windows build and test results for #4500 will be on that PR.
AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126682310 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6126682310). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T14:51:17Z. --- `Overlap note: PR #4500 (storage image access to depth surfaces, with its own execution test) was opened after this PR and also targets #1409. It takes a view of another extent or format through the ordinary texture path, which is the case where this PR fails \`agc_driver_depth_storage_reuse\` on \`main\` (see the comment above). Both touch \`DepthSurface.cpp\` and \`ShaderResources.cpp\` (\`cachedStorageTexture\`), so they will conflict whichever lands second. I am no longer writing a separate execution test for this PR; the Windows build and test results for #4500 will be on that PR. ` `AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 15:01:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T15:01:27Z.


Title data point for the cube branch of this PR: Harmony's Odyssey (PPSA16827) stops on main at a cube-map sampling of a 1024x1024 D32 depth surface as R32_FLOAT (details in https://github.com/boykopovar/AnyPS5/issues/1409#issuecomment-6126865042). The cube branch of the depth-plane copy here may cover it, but that is not tested; a run with this PR merged onto main is possible once the machine is free.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126870000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6126870000). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T15:01:27Z. --- Title data point for the cube branch of this PR: Harmony's Odyssey (PPSA16827) stops on `main` at a cube-map sampling of a 1024x1024 D32 depth surface as R32_FLOAT (details in https://github.com/boykopovar/AnyPS5/issues/1409#issuecomment-6126865042). The cube branch of the depth-plane copy here may cover it, but that is not tested; a run with this PR merged onto `main` is possible once the machine is free. AI-assisted (Claude Code).
MichonGoddijn231849 commented 2026-10-12 16:07:46 +00:00 (Migrated from github.com)

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


Rewritten on current main (82b1b2e7a), head e6d75b417, now only the sampled views. #4500 implements storage-image access to depth surfaces, with stencil planes and the reused-memory fall-through, so I took the storage half out instead of having both PRs conflict:

  • The PR samples depth planes as 2D arrays, cubes and R16_UINT views.
  • agc_driver_depth_plane_sampling pins the values read: D32 array slices from a drawn surface and from guest memory, all six cube faces, a D16 plane as R16_UINT, a D16 depth-bits array, and the base-slice refusal.
  • TechnicalDebt and ARCHITECTURE have their lines.
  • Description and title are updated, and it now says "Part of #1409" (#4500 covers the storage half).

@xXPBSXx thanks for finding the agc_driver_depth_storage_reuse failure: that came from the storage half, which is gone, and the test passes on this head.

@tibzejoker thanks for the GTA V case. The test showed that routing a depth-bits R16_UINT view through the integer copy reads 0: for a T# with a depth swizzle the shader converts the sampled depth to its bits itself, so it needs the depth copy, not an R16_UINT image. The fix lets such a view through the format check and keeps the depth copy. The test's depth-bits array case reads both slices' raw values, and without the change it fails with your message.

@Kikoarl a correction to my earlier comment: tests/execution/*.cpp is picked up by a glob in libSceAgcDriver/CMakeLists.txt, so your test file was registered after all. Sorry about that. The other two points stand. The tests are written now; thanks for offering.

@ThatsLeo #4500 also covers the stencil plane as storage, so your branch is worth comparing with it there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128004459 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6128004459). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-12T16:07:46Z. --- Rewritten on current `main` (`82b1b2e7a`), head `e6d75b417`, now only the sampled views. #4500 implements storage-image access to depth surfaces, with stencil planes and the reused-memory fall-through, so I took the storage half out instead of having both PRs conflict: - The PR samples depth planes as 2D arrays, cubes and R16_UINT views. - `agc_driver_depth_plane_sampling` pins the values read: D32 array slices from a drawn surface and from guest memory, all six cube faces, a D16 plane as R16_UINT, a D16 depth-bits array, and the base-slice refusal. - TechnicalDebt and ARCHITECTURE have their lines. - Description and title are updated, and it now says "Part of #1409" (#4500 covers the storage half). @xXPBSXx thanks for finding the `agc_driver_depth_storage_reuse` failure: that came from the storage half, which is gone, and the test passes on this head. @tibzejoker thanks for the GTA V case. The test showed that routing a depth-bits R16_UINT view through the integer copy reads 0: for a T# with a depth swizzle the shader converts the sampled depth to its bits itself, so it needs the depth copy, not an R16_UINT image. The fix lets such a view through the format check and keeps the depth copy. The test's depth-bits array case reads both slices' raw values, and without the change it fails with your message. @Kikoarl a correction to my earlier comment: `tests/execution/*.cpp` is picked up by a glob in `libSceAgcDriver/CMakeLists.txt`, so your test file was registered after all. Sorry about that. The other two points stand. The tests are written now; thanks for offering. @ThatsLeo #4500 also covers the stencil plane as storage, so your branch is worth comparing with it there.
xXPBSXx commented 2026-10-12 16:38:07 +00:00 (Migrated from github.com)

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


A diagnosis for the agc_driver_depth_storage_reuse failure reported above, found in the merge of this head onto main (2a5eca11c) while looking at Harmony's Odyssey (#1409). Not run yet on the GPU; the build and agc_driver_graphics (mock device, 1/1) pass.

main decides in cachedStorageTexture whether a storage image is a view of a depth surface with DepthSurfaceAt(context, words, viewed) (DepthSurface.cpp, the three-argument overload): it only matches when the extent equals the depth target's and the format is the plane's (or the T# holds depth bits). This head replaces main's throw with Require(!DepthStencilPlaneAt(viewed.baseAddress), ...) and if (DepthSurfaceAt(viewed.baseAddress)) SeedStorageFromDepth(...), which uses the one-argument overload, so any image at the depth target's address, whatever its shape, goes through Transfer. In depth_storage_reuse the 32x32 R32_SFLOAT image over the 64x32 target is exactly that case, and Transfer throws on the extent.

The change that keeps main's decision is one condition in cachedStorageTexture:

const bool depthView = DepthSurfaceAt(context, words, viewed);
Require(!(depthView && DepthStencilPlaneAt(viewed.baseAddress)), "storage access to a depth surface's stencil plane is not implemented");
auto texture = lookupStorageTexture(context, words, viewed, mip, guestBytes);
if (depthView) SeedStorageFromDepth(context, texture);

I have this as one commit on top of the merge on my fork (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, 5ef0e5144); it is for you to take or not, I am not touching your branch. The GPU result of depth_storage_reuse with it is still to come.

Two questions so that nobody writes the same thing twice, @MichonGoddijn231849 and the maintainers (@oneandonlydean, @adriadam10): #4500 now covers storage image access to depth surfaces (with its own execution test), and Harmony's Odyssey needs the cube branch of the depth-plane copy from this PR (sampling). Would you want the sampling part (2D array, cube, R16_UINT copies) to go on as a PR of its own, with the pinned-value execution test the review asks for, and leave the storage part to #4500? I can carry that with your commits' authorship kept, if you prefer it that way; if you would rather do it yourselves, say so and I will only test it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128493232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6128493232). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T16:38:07Z. --- A diagnosis for the `agc_driver_depth_storage_reuse` failure reported above, found in the merge of this head onto `main` (`2a5eca11c`) while looking at Harmony's Odyssey (#1409). Not run yet on the GPU; the build and `agc_driver_graphics` (mock device, 1/1) pass. `main` decides in `cachedStorageTexture` whether a storage image is a view of a depth surface with `DepthSurfaceAt(context, words, viewed)` (`DepthSurface.cpp`, the three-argument overload): it only matches when the extent equals the depth target's and the format is the plane's (or the T# holds depth bits). This head replaces main's throw with `Require(!DepthStencilPlaneAt(viewed.baseAddress), ...)` and `if (DepthSurfaceAt(viewed.baseAddress)) SeedStorageFromDepth(...)`, which uses the one-argument overload, so any image at the depth target's address, whatever its shape, goes through `Transfer`. In `depth_storage_reuse` the 32x32 `R32_SFLOAT` image over the 64x32 target is exactly that case, and `Transfer` throws on the extent. The change that keeps main's decision is one condition in `cachedStorageTexture`: ```cpp const bool depthView = DepthSurfaceAt(context, words, viewed); Require(!(depthView && DepthStencilPlaneAt(viewed.baseAddress)), "storage access to a depth surface's stencil plane is not implemented"); auto texture = lookupStorageTexture(context, words, viewed, mip, guestBytes); if (depthView) SeedStorageFromDepth(context, texture); ``` I have this as one commit on top of the merge on my fork (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, `5ef0e5144`); it is for you to take or not, I am not touching your branch. The GPU result of `depth_storage_reuse` with it is still to come. Two questions so that nobody writes the same thing twice, @MichonGoddijn231849 and the maintainers (@oneandonlydean, @adriadam10): #4500 now covers storage image access to depth surfaces (with its own execution test), and Harmony's Odyssey needs the cube branch of the depth-plane copy from this PR (sampling). Would you want the sampling part (2D array, cube, `R16_UINT` copies) to go on as a PR of its own, with the pinned-value execution test the review asks for, and leave the storage part to #4500? I can carry that with your commits' authorship kept, if you prefer it that way; if you would rather do it yourselves, say so and I will only test it. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 16:44:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T16:44:21Z.


GPU result for the one-condition change above (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, 5ef0e5144, merge of this head onto main 2a5eca11c): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, RTX 4080 SUPER. agc_driver_depth_storage_reuse passes with it (it failed without), and so do agc_driver_depth_compare_copy, depth_fast_clear, depth_fast_clear_submit, depth_bias_per_face, pending_exact_surface and agc_driver_graphics (7 of 7 in the filter agc_driver_(depth_storage_reuse|depth_compare_copy|depth_fast_clear|depth_fast_clear_submit|depth_bias_per_face|pending_exact_surface|graphics$)).

So the regression is the one-argument DepthSurfaceAt in cachedStorageTexture, and the change above is enough to remove it. Not checked: Linux, other GPUs, and whether any title needs the stricter check.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128590332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6128590332). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T16:44:21Z. --- GPU result for the one-condition change above (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, `5ef0e5144`, merge of this head onto `main` `2a5eca11c`): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, RTX 4080 SUPER. `agc_driver_depth_storage_reuse` passes with it (it failed without), and so do `agc_driver_depth_compare_copy`, `depth_fast_clear`, `depth_fast_clear_submit`, `depth_bias_per_face`, `pending_exact_surface` and `agc_driver_graphics` (7 of 7 in the filter `agc_driver_(depth_storage_reuse|depth_compare_copy|depth_fast_clear|depth_fast_clear_submit|depth_bias_per_face|pending_exact_surface|graphics$)`). So the regression is the one-argument `DepthSurfaceAt` in `cachedStorageTexture`, and the change above is enough to remove it. Not checked: Linux, other GPUs, and whether any title needs the stricter check. AI-assisted (Claude Code).
MichonGoddijn231849 commented 2026-10-12 16:47:14 +00:00 (Migrated from github.com)

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


@xXPBSXx thanks. Your diagnosis is right for f470ffaa2, but the current head e6d75b417 (16:07) is already the split you suggest. The storage half is gone (Transfer, SeedStorageFromDepth, DepthStencilPlaneAt and the cachedStorageTexture change), so main's three-argument DepthSurfaceAt decides again, and agc_driver_depth_storage_reuse passes here with it. What is left is the sampling part: 2D array, cube and R16_UINT copies, with the pinned-value execution test agc_driver_depth_plane_sampling (array slices, six cube faces, D16 as R16_UINT, the depth-bits array, and the refusal of base slice 1). No need to carry it; a run of Harmony's Odyssey's cube sample on this head would help.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128633065 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6128633065). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-12T16:47:14Z. --- @xXPBSXx thanks. Your diagnosis is right for `f470ffaa2`, but the current head `e6d75b417` (16:07) is already the split you suggest. The storage half is gone (`Transfer`, `SeedStorageFromDepth`, `DepthStencilPlaneAt` and the `cachedStorageTexture` change), so main's three-argument `DepthSurfaceAt` decides again, and `agc_driver_depth_storage_reuse` passes here with it. What is left is the sampling part: 2D array, cube and `R16_UINT` copies, with the pinned-value execution test `agc_driver_depth_plane_sampling` (array slices, six cube faces, D16 as `R16_UINT`, the depth-bits array, and the refusal of base slice 1). No need to carry it; a run of Harmony's Odyssey's cube sample on this head would help.
xXPBSXx commented 2026-10-12 17:05:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T17:05:08Z.


Title result for the cube branch of this PR: Harmony's Odyssey (PPSA16827) ran 240 s with this PR plus the cachedStorageTexture change above without the cube-sampling refusal (details and limits: https://github.com/boykopovar/AnyPS5/issues/1409#issuecomment-6128903521). Rendering correctness and frame rate were not assessed here.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128907188 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6128907188). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T17:05:08Z. --- Title result for the cube branch of this PR: Harmony's Odyssey (PPSA16827) ran 240 s with this PR plus the `cachedStorageTexture` change above without the cube-sampling refusal (details and limits: https://github.com/boykopovar/AnyPS5/issues/1409#issuecomment-6128903521). Rendering correctness and frame rate were not assessed here. AI-assisted (Claude Code).
alfalfa-star commented 2026-10-12 19:45:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-12T19:45:50Z.


Kena: Bridge of Spirits (PPSA01802) data point for this PR: with it, the title reaches gameplay. Its point-light shadow maps are 128x128 D16 cubes in a 64 KiB Z swizzle, so the detiled rows are padded to 256 texels, and DepthPlaneCopy refused them (depth plane copy geometry does not match its layers, about 4,400 skipped shadow draws per run). The fix is in #4722 on top of this head, with a PaddedCubeCase test. Feel free to take the commit into this PR instead.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131429668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6131429668). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-12T19:45:50Z. --- Kena: Bridge of Spirits (PPSA01802) data point for this PR: with it, the title reaches gameplay. Its point-light shadow maps are 128x128 D16 cubes in a 64 KiB Z swizzle, so the detiled rows are padded to 256 texels, and `DepthPlaneCopy` refused them (`depth plane copy geometry does not match its layers`, about 4,400 skipped shadow draws per run). The fix is in #4722 on top of this head, with a `PaddedCubeCase` test. Feel free to take the commit into this PR instead.
GustavoGamarra95 commented 2026-10-12 20:00:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GustavoGamarra95 on 2026-10-12T20:00:34Z.


@MichonGoddijn231849 a case this PR needs for Beast of Reincarnation (PPSA29343, Unreal Engine): at start-up the title samples a 32x32 D16 depth surface as a six-face cube through a depth-bits view (T# format 7, swizzle 24, type cube). Its faces are narrower than a 64 KiB block, so DescribeSurface gives padded linear slices of 16384 bytes while DepthPlaneCopy lays out tight 2048-byte slices, and the title stops with depth plane copy geometry does not match its layers.

Two commits on top of this PR's head e6d75b4, in case you want to take them (authorship kept, happy to adjust anything):

  • 2c284db fix(agc): copy a depth surface's plane through the texture's padded linear slices: the copy regions take the mip's linear offset and pitch, the staging buffer grows to the padded size, and a mismatch says which geometry it saw.
  • 1b3d403 test(agc): sample a small D16 cube whose linear slices are padded: a new case in agc_driver_depth_plane_sampling (face 0 from the live surface, faces 1-5 from guest memory). The draw helper sizes its color target with ColorTargetLayout, since a linear 32x32 target is padded to a 64-pixel pitch.

Branch: GustavoGamarra95:fix/agc-depth-copy-padded-slices. On Linux with an RTX 3050 Laptop (NVIDIA 615.78.08) the new case fails on e6d75b4 with the same message as the title and passes with the fix; the six depth ctests pass and tools/check_conventions.py passes. With it the title boots to its menu on a local branch of current main with this PR, #4500 and the title's other rendering fixes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131651482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6131651482). Originally posted by [GustavoGamarra95](https://github.com/GustavoGamarra95) on 2026-10-12T20:00:34Z. --- @MichonGoddijn231849 a case this PR needs for Beast of Reincarnation (PPSA29343, Unreal Engine): at start-up the title samples a 32x32 D16 depth surface as a six-face cube through a depth-bits view (T# format 7, swizzle 24, type cube). Its faces are narrower than a 64 KiB block, so `DescribeSurface` gives padded linear slices of 16384 bytes while `DepthPlaneCopy` lays out tight 2048-byte slices, and the title stops with `depth plane copy geometry does not match its layers`. Two commits on top of this PR's head e6d75b4, in case you want to take them (authorship kept, happy to adjust anything): - [2c284db](https://github.com/GustavoGamarra95/AnyPS5/commit/2c284db77) fix(agc): copy a depth surface's plane through the texture's padded linear slices: the copy regions take the mip's linear offset and pitch, the staging buffer grows to the padded size, and a mismatch says which geometry it saw. - [1b3d403](https://github.com/GustavoGamarra95/AnyPS5/commit/1b3d403c4) test(agc): sample a small D16 cube whose linear slices are padded: a new case in `agc_driver_depth_plane_sampling` (face 0 from the live surface, faces 1-5 from guest memory). The draw helper sizes its color target with `ColorTargetLayout`, since a linear 32x32 target is padded to a 64-pixel pitch. Branch: [GustavoGamarra95:fix/agc-depth-copy-padded-slices](https://github.com/GustavoGamarra95/AnyPS5/tree/fix/agc-depth-copy-padded-slices). On Linux with an RTX 3050 Laptop (NVIDIA 615.78.08) the new case fails on e6d75b4 with the same message as the title and passes with the fix; the six `depth` ctests pass and `tools/check_conventions.py` passes. With it the title boots to its menu on a local branch of current main with this PR, #4500 and the title's other rendering fixes.
xXPBSXx commented 2026-10-12 20:47:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T20:47:42Z.


Repeat runs for the branch above (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, 5ef0e5144), as promised on #1409: agc_driver_depth_storage_reuse, agc_driver_depth_compare_copy, agc_driver_depth_fast_clear and agc_driver_depth_fast_clear_submit each ran three times in a row, 12 of 12 passes, no flicker (Windows 10, MinGW-w64 GCC 15.2.0, Release, RTX 4080 SUPER, built -j2). With the earlier single run of depth_bias_per_face, pending_exact_surface and agc_driver_graphics that covers the depth tests of the tree. Not checked: Linux, other GPUs, a rendering check of the cube map.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132342453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6132342453). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T20:47:42Z. --- Repeat runs for the branch above (https://github.com/xXPBSXx/AnyPS5/tree/test/depth-harmony-425-on-main, `5ef0e5144`), as promised on #1409: `agc_driver_depth_storage_reuse`, `agc_driver_depth_compare_copy`, `agc_driver_depth_fast_clear` and `agc_driver_depth_fast_clear_submit` each ran three times in a row, 12 of 12 passes, no flicker (Windows 10, MinGW-w64 GCC 15.2.0, Release, RTX 4080 SUPER, built `-j2`). With the earlier single run of `depth_bias_per_face`, `pending_exact_surface` and `agc_driver_graphics` that covers the depth tests of the tree. Not checked: Linux, other GPUs, a rendering check of the cube map. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-12 22:41:13 +00:00 (Migrated from github.com)

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


This needs a rebase on main and two fixes before it can go in:

  • DepthSurface.cpp:136 conflicts with #3846: the view takes hostFormat and keeps your viewType. The TechnicalDebt entry moves to docs/dev/debt/libSceAgcDriver.md; Conventions fails on it now.
  • Texture.cpp:663: the depth-plane constructor makes no first-layer view, so a 2D array T# over a depth surface bound to a shader image declared 2D gets a null view (ShaderResources.cpp:1622) and reads 0, where main throws. Please create the 2D first-layer view when the view is a 2D array, and pin it in the test: image_load with dim 2D on the array T# reads 0x00000000 for 0x3e800000 here, with one slice and with three.
  • DepthSurface.cpp:416: since #3846 a D16 surface with stencil is stored as D24 or D32, so the plane copy writes 4 bytes per texel into 2-byte slices (VUID-vkCmdCopyImageToBuffer-pRegions-00183; the R16_UINT view reads 0x33 for 0x3333). Please throw when the surface's host format isn't the plane's, as #4500 does for storage.

Merged with main 27873b0f the rest holds: agc|shader is 459 of 459, and the new test fails on main's sources with main's refusal.

A patch that does the two fixes, if it helps:

--- a/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
@@ -441,6 +441,7 @@ std::shared_ptr<Texture> DepthSurfaceTexture(const Context& context, std::span<c
     const bool cube = resource.dimension == TextureDimension::kCube;
     const bool layered = cube || (resource.dimension == TextureDimension::k2DArray && resource.depthOrLastArray != 0);
     if (stencil || (!layered && !integer)) return (*found)->Sampled(words, resource, components);
+    Require((*found)->hostFormat == base.format, "sampling several slices or an integer view of a depth plane that the device stores in another depth format is not implemented");
     const auto copyFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT;
     const auto layers = cube ? 6u : layered ? resource.depthOrLastArray + 1u : 1u;
     if ((format != copyFormat && !depthBits) || resource.width != base.extent.width || resource.height != base.extent.height || resource.baseLevel != 0 || resource.lastLevel != 0 || resource.baseArray != 0 || (cube && resource.depthOrLastArray != 0 && resource.depthOrLastArray != 5) || (resource.dimension != TextureDimension::k2D && resource.dimension != TextureDimension::k2DArray && !cube)) {
--- a/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
@@ -671,6 +671,11 @@ Texture::Texture(const Context& context, VkImage depthImage, VkFormat depthForma
     viewInfo.subresourceRange = {aspect, 0, 1, 0, viewType == VK_IMAGE_VIEW_TYPE_2D ? 1u : VK_REMAINING_ARRAY_LAYERS};
     Check(context.Function<PFN_vkCreateImageView>("vkCreateImageView")(context.device, &viewInfo, nullptr, &view), "vkCreateImageView depth plane");
     viewRange = {viewInfo.viewType, viewInfo.subresourceRange.levelCount, viewInfo.subresourceRange.layerCount};
+    if (viewType != VK_IMAGE_VIEW_TYPE_2D_ARRAY) return;
+    viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
+    viewInfo.subresourceRange.layerCount = 1;
+    Check(context.Function<PFN_vkCreateImageView>("vkCreateImageView")(context.device, &viewInfo, nullptr, &firstLayerView), "vkCreateImageView depth plane first layer");
+    firstLayerRange = {viewInfo.viewType, viewInfo.subresourceRange.levelCount, viewInfo.subresourceRange.layerCount};
 }
 
 Texture::~Texture() {

Data point from a title we test with: on main it stops before its title screen at storage image access to depth/stencil surface 0x53a500000 is not implemented (compute shader 0x50073d500); with #4500 it reaches sampling the depth plane of depth surface 0x528c30000 (1536x1536, vk format 126) ... dimension 2 ... is not implemented (compute shader 0x500599900); with #4500 and this head merged onto main 682ef0c1 it runs 330 s with no stop, error line or device loss. Title and menu then run at 0.78 and 0.63 fps, which is the per-use copy; #2490 and #2491 are for that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134004236 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6134004236). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T22:41:13Z. --- This needs a rebase on main and two fixes before it can go in: - `DepthSurface.cpp:136` conflicts with #3846: the view takes `hostFormat` and keeps your `viewType`. The TechnicalDebt entry moves to `docs/dev/debt/libSceAgcDriver.md`; Conventions fails on it now. - `Texture.cpp:663`: the depth-plane constructor makes no first-layer view, so a 2D array T# over a depth surface bound to a shader image declared 2D gets a null view (`ShaderResources.cpp:1622`) and reads 0, where main throws. Please create the 2D first-layer view when the view is a 2D array, and pin it in the test: `image_load` with dim 2D on the array T# reads `0x00000000` for `0x3e800000` here, with one slice and with three. - `DepthSurface.cpp:416`: since #3846 a D16 surface with stencil is stored as D24 or D32, so the plane copy writes 4 bytes per texel into 2-byte slices (`VUID-vkCmdCopyImageToBuffer-pRegions-00183`; the R16_UINT view reads `0x33` for `0x3333`). Please throw when the surface's host format isn't the plane's, as #4500 does for storage. Merged with main 27873b0f the rest holds: `agc|shader` is 459 of 459, and the new test fails on main's sources with main's refusal. A patch that does the two fixes, if it helps: ```diff --- a/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp @@ -441,6 +441,7 @@ std::shared_ptr<Texture> DepthSurfaceTexture(const Context& context, std::span<c const bool cube = resource.dimension == TextureDimension::kCube; const bool layered = cube || (resource.dimension == TextureDimension::k2DArray && resource.depthOrLastArray != 0); if (stencil || (!layered && !integer)) return (*found)->Sampled(words, resource, components); + Require((*found)->hostFormat == base.format, "sampling several slices or an integer view of a depth plane that the device stores in another depth format is not implemented"); const auto copyFormat = integer ? VK_FORMAT_R16_UINT : d16 ? VK_FORMAT_R16_UNORM : VK_FORMAT_R32_SFLOAT; const auto layers = cube ? 6u : layered ? resource.depthOrLastArray + 1u : 1u; if ((format != copyFormat && !depthBits) || resource.width != base.extent.width || resource.height != base.extent.height || resource.baseLevel != 0 || resource.lastLevel != 0 || resource.baseArray != 0 || (cube && resource.depthOrLastArray != 0 && resource.depthOrLastArray != 5) || (resource.dimension != TextureDimension::k2D && resource.dimension != TextureDimension::k2DArray && !cube)) { --- a/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp @@ -671,6 +671,11 @@ Texture::Texture(const Context& context, VkImage depthImage, VkFormat depthForma viewInfo.subresourceRange = {aspect, 0, 1, 0, viewType == VK_IMAGE_VIEW_TYPE_2D ? 1u : VK_REMAINING_ARRAY_LAYERS}; Check(context.Function<PFN_vkCreateImageView>("vkCreateImageView")(context.device, &viewInfo, nullptr, &view), "vkCreateImageView depth plane"); viewRange = {viewInfo.viewType, viewInfo.subresourceRange.levelCount, viewInfo.subresourceRange.layerCount}; + if (viewType != VK_IMAGE_VIEW_TYPE_2D_ARRAY) return; + viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + viewInfo.subresourceRange.layerCount = 1; + Check(context.Function<PFN_vkCreateImageView>("vkCreateImageView")(context.device, &viewInfo, nullptr, &firstLayerView), "vkCreateImageView depth plane first layer"); + firstLayerRange = {viewInfo.viewType, viewInfo.subresourceRange.levelCount, viewInfo.subresourceRange.layerCount}; } Texture::~Texture() { ``` Data point from a title we test with: on `main` it stops before its title screen at `storage image access to depth/stencil surface 0x53a500000 is not implemented` (compute shader `0x50073d500`); with #4500 it reaches `sampling the depth plane of depth surface 0x528c30000 (1536x1536, vk format 126) ... dimension 2 ... is not implemented` (compute shader `0x500599900`); with #4500 and this head merged onto `main` 682ef0c1 it runs 330 s with no stop, error line or device loss. Title and menu then run at 0.78 and 0.63 fps, which is the per-use copy; #2490 and #2491 are for that.
oneandonlydean commented 2026-10-12 23:32:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T23:32:49Z.


Pushed the rebase and the two fixes from the comment above so this can go in (head 90d899d98). Your two commits are unchanged apart from the conflict in Sampled, which takes hostFormat from #3846 and keeps your viewType; the debt entry moved to docs/dev/debt/libSceAgcDriver.md. The third commit adds the first-slice view for 2D array depth views and the refusal when the device stores the plane in another depth format, with a case for each (DepthPlaneSampling.cpp, DepthSurfaceReuse.cpp). agc|shader is 461 of 461 here, and a full build is running: https://github.com/boykopovar/AnyPS5/actions/runs/38322596395. I'll merge when it is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134637836 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6134637836). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T23:32:49Z. --- Pushed the rebase and the two fixes from the comment above so this can go in (head 90d899d98). Your two commits are unchanged apart from the conflict in `Sampled`, which takes `hostFormat` from #3846 and keeps your `viewType`; the debt entry moved to `docs/dev/debt/libSceAgcDriver.md`. The third commit adds the first-slice view for 2D array depth views and the refusal when the device stores the plane in another depth format, with a case for each (`DepthPlaneSampling.cpp`, `DepthSurfaceReuse.cpp`). `agc|shader` is 461 of 461 here, and a full build is running: https://github.com/boykopovar/AnyPS5/actions/runs/38322596395. I'll merge when it is green.
github-actions[bot] commented 2026-10-12 23:36:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T23:36:38Z.


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
#2076 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L47, L143, L152-154
core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp L183
#4500 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L47, L143, L152-154
core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp L183
#4646 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L240-241, L291, L294-295
#4683 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L47, L241-242, L290-291, L296-312
#4747 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp L69-70, L128
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp L478, L537-539
#4820 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L1719
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134680931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/425#issuecomment-6134680931). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T23:36:38Z. --- <!-- 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 | |---|---|---|---| | #2076 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L47](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L47), [L143](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L143), [L152-154](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L152-L154)<br>`core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp` [L183](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp#L183) | | | | #4500 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L47](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L47), [L143](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L143), [L152-154](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L152-L154)<br>`core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp` [L183](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp#L183) | | | | #4646 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L240-241](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L240-L241), [L291](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L291), [L294-295](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L294-L295) | | | | #4683 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L47](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L47), [L241-242](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L241-L242), [L290-291](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L290-L291), [L296-312](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L296-L312) | | | | #4747 | `core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp` [L69-70](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp#L69-L70), [L128](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp#L128)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` [L478](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L478), [L537-539](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L537-L539) | | | | #4820 | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L1719](https://github.com/boykopovar/AnyPS5/blob/e55b881f0f29084f290bd414b2692da16cbf945c/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1719) | | |
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!425
No description provided.