fix(libSceAgcDriver): sample a PS4 depth buffer through a T# smaller than its padded extent #9672

Merged
ntamas94 merged 9 commits from upstream-pr/9672 into main 2026-11-03 16:43:14 +00:00
ntamas94 commented 2026-10-22 07:45:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T07:45:02Z.


What

On the PS4 a depth target's extent is decoded from DB_DEPTH_SIZE, which holds the surface padded to whole macro tiles: the 1920x1080 Depth2D64 depth buffer of Gang Beasts (CUSA04865, Unity) is 2048x1152. The title then samples the depth plane through an R32F T# of the real size: 1920x1080, same base address, GCN pitch 2048. DepthSurfaceTexture only took a view of exactly the target's extent, so this view fell back to guest memory, which never holds native depth. The depth-of-field and lighting passes read whatever the memory held:

  • the background and foreground showed a blurred image with a regular 8-pixel dot grid, in alternating frames;
  • shadows were missing;
  • it got worse once Unity's render-texture pool reused that memory: the first menu was clean, the menu after a match was not.

On the console the same scenes are sharp and stable.

A PS4 depth target now records that it is one (DepthTarget::gcn, set where the padded extent is decoded). A view of its depth plane is served by the existing depth plane copy when all of these hold:

  • it is 2D, level 0 and no larger than the padded extent;
  • its GCN pitch is the DB pitch;
  • the device keeps the plane in the guest's depth format.

The copy is sized and keyed by the view: it copies the view-sized top-left corner of the native depth, so texel (x,y) of the T# reads depth texel (x,y), and normalized coordinates and clamping follow the T#. A view of the exact extent, and every PS5 target, keep the previous path. A smaller view of the stencil plane still reads guest memory; the debt entry says so. Like the other plane copies, the copy is refreshed on each lookup while the surface is the last drawn depth target.

This moves Get-fix/AnyPS5#9 (opened against ps4/limbo-gpu) to main, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has current main merged in. main meanwhile keys the plane copies without the layer count and evicts them over a budget (APS5_DEPTH_PLANE_COPY_MIB); the view-sized key and extent of this PR go into that key, so a cropped and a full-size view of one target are two copies under the same budget. main's cube-array rule for depth planes (any multiple of six layers) is kept in the planes condition.

Tested

Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with BUILD_TESTING=ON, on this branch with current main (7d9a2fc713) merged in; #9431 is merged, so the branch's diff against main is this PR's own change:

  • agc_driver_gcn_padded_depth_sampling (new) draws known depth into 64x64 D32 and D16 targets flagged as PS4 and reads it through 48x40 views. It checks 26 texels including the right and bottom edges, 6 out-of-range coordinates that clamp to the view's edge, and the same again after a redraw. It passes; with DepthSurface.cpp reverted to the base it reads guest memory and fails (read 0.00000000, expected 0.25000000).
  • agc_driver_graphics and the depth execution tests pass: depth_bias_per_face, depth_compare_copy, depth_fast_clear, depth_fast_clear_submit, depth_htile_write, depth_plane_guest_layers, depth_plane_sampling, depth_storage, depth_storage_dispatch, depth_storage_reuse, depth_surface_from_storage, depth_surface_last_writer, gcn_detile, native_multisample_depth, sample_mask_depth_stencil, stencil_replay, stencil_replay_no_gpl, native_depth_retirement, native_depth_clears, native_depth_clear_refusals; three runs each, with --timeout 300; main's stencil_plane_memory passes too: native_multisample_depth takes 1 to 2 s alone on both this branch and main, but ran past its 30 s limit while builds loaded the machine.
  • The test binds an RDNA-style T# over the PS4 target, because the execution harness has no GCN descriptor path; the GCN T# decode is covered by the game run below.
  • Gang Beasts, earlier on Get-fix/AnyPS5#9 with my bring-up branch (#7941):
    • The crop is taken for the title's depth views (DB 2048x1152, view 1920x1080, GCN pitch 2048).
    • A 10-minute run through three levels and back to the menu twice shows no dot grid and no false blur, and the shadows are back.
    • In an 18-frame burst in the same level, the count of isolated bright pixels used to alternate between about 1,000 and 5,000-34,000. It now stays near 500, which is the edges of high-frequency textures.
  • tools/check_conventions.py --base main (7d9a2fc713) with this title and description: no findings. The debt change is one sentence in the "PS4 render targets and display buffers" entry; "Depth plane copies" is untouched.
  • Paired validation-layer run: main 7d9a2fc713 (100% tests passed out of 25, the depth, display-buffer and graphics tests of this stack) and this branch with that main merged in (100% tests passed out of 23, the tests above and stencil_plane_memory) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V --timeout 300, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (62 and 62 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0.
  • TechLevelZero's NVIDIA CI (https://github.com/boykopovar/AnyPS5/pull/9672#issuecomment-6497922570) on the previous head 43497e2a96 merged onto main ba5b533: build passed, 2,211 tests passed, 0 new failures (3 also fail on main, 1 unstable there), no new validation IDs against main in 856 GPU tests, on an NVIDIA RTX 2000 Ada under Ubuntu.

Checklist

  • Based on current main; no other open PR implements the same functions (current main 7d9a2fc713 merged in; #9431 is merged; searched open boykopovar/AnyPS5 PRs for padded depth, depth extent and DB_DEPTH_SIZE on 2026-10-22)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (#9431 is merged)
  • Fixes: none
  • Unblocks: CUSA04865 #7941
  • GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4963905800 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T07:45:02Z. --- ### What On the PS4 a depth target's extent is decoded from `DB_DEPTH_SIZE`, which holds the surface padded to whole macro tiles: the 1920x1080 Depth2D64 depth buffer of Gang Beasts (CUSA04865, Unity) is 2048x1152. The title then samples the depth plane through an R32F T# of the real size: 1920x1080, same base address, GCN pitch 2048. `DepthSurfaceTexture` only took a view of exactly the target's extent, so this view fell back to guest memory, which never holds native depth. The depth-of-field and lighting passes read whatever the memory held: - the background and foreground showed a blurred image with a regular 8-pixel dot grid, in alternating frames; - shadows were missing; - it got worse once Unity's render-texture pool reused that memory: the first menu was clean, the menu after a match was not. On the console the same scenes are sharp and stable. A PS4 depth target now records that it is one (`DepthTarget::gcn`, set where the padded extent is decoded). A view of its depth plane is served by the existing depth plane copy when all of these hold: - it is 2D, level 0 and no larger than the padded extent; - its GCN pitch is the DB pitch; - the device keeps the plane in the guest's depth format. The copy is sized and keyed by the view: it copies the view-sized top-left corner of the native depth, so texel (x,y) of the T# reads depth texel (x,y), and normalized coordinates and clamping follow the T#. A view of the exact extent, and every PS5 target, keep the previous path. A smaller view of the stencil plane still reads guest memory; the debt entry says so. Like the other plane copies, the copy is refreshed on each lookup while the surface is the last drawn depth target. This moves Get-fix/AnyPS5#9 (opened against `ps4/limbo-gpu`) to `main`, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has current `main` merged in. `main` meanwhile keys the plane copies without the layer count and evicts them over a budget (`APS5_DEPTH_PLANE_COPY_MIB`); the view-sized key and extent of this PR go into that key, so a cropped and a full-size view of one target are two copies under the same budget. `main`'s cube-array rule for depth planes (any multiple of six layers) is kept in the `planes` condition. ### Tested Windows 11 Pro (10.0.26200), WinLibs GCC, NVIDIA GeForce RTX 2080 (driver 617.14), Release build with `BUILD_TESTING=ON`, on this branch with current `main` (7d9a2fc713) merged in; #9431 is merged, so the branch's diff against `main` is this PR's own change: - `agc_driver_gcn_padded_depth_sampling` (new) draws known depth into 64x64 D32 and D16 targets flagged as PS4 and reads it through 48x40 views. It checks 26 texels including the right and bottom edges, 6 out-of-range coordinates that clamp to the view's edge, and the same again after a redraw. It passes; with `DepthSurface.cpp` reverted to the base it reads guest memory and fails (`read 0.00000000, expected 0.25000000`). - `agc_driver_graphics` and the depth execution tests pass: `depth_bias_per_face`, `depth_compare_copy`, `depth_fast_clear`, `depth_fast_clear_submit`, `depth_htile_write`, `depth_plane_guest_layers`, `depth_plane_sampling`, `depth_storage`, `depth_storage_dispatch`, `depth_storage_reuse`, `depth_surface_from_storage`, `depth_surface_last_writer`, `gcn_detile`, `native_multisample_depth`, `sample_mask_depth_stencil`, `stencil_replay`, `stencil_replay_no_gpl`, `native_depth_retirement`, `native_depth_clears`, `native_depth_clear_refusals`; three runs each, with `--timeout 300`; `main`'s `stencil_plane_memory` passes too: `native_multisample_depth` takes 1 to 2 s alone on both this branch and `main`, but ran past its 30 s limit while builds loaded the machine. - The test binds an RDNA-style T# over the PS4 target, because the execution harness has no GCN descriptor path; the GCN T# decode is covered by the game run below. - Gang Beasts, earlier on Get-fix/AnyPS5#9 with my bring-up branch (#7941): - The crop is taken for the title's depth views (DB 2048x1152, view 1920x1080, GCN pitch 2048). - A 10-minute run through three levels and back to the menu twice shows no dot grid and no false blur, and the shadows are back. - In an 18-frame burst in the same level, the count of isolated bright pixels used to alternate between about 1,000 and 5,000-34,000. It now stays near 500, which is the edges of high-frequency textures. - `tools/check_conventions.py --base main` (7d9a2fc713) with this title and description: no findings. The debt change is one sentence in the "PS4 render targets and display buffers" entry; "Depth plane copies" is untouched. - Paired validation-layer run: `main` 7d9a2fc713 (100% tests passed out of 25, the depth, display-buffer and graphics tests of this stack) and this branch with that `main` merged in (100% tests passed out of 23, the tests above and `stencil_plane_memory`) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V --timeout 300`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (62 and 62 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. - TechLevelZero's NVIDIA CI (https://github.com/boykopovar/AnyPS5/pull/9672#issuecomment-6497922570) on the previous head 43497e2a96 merged onto `main` ba5b533: build passed, 2,211 tests passed, 0 new failures (3 also fail on `main`, 1 unstable there), no new validation IDs against `main` in 856 GPU tests, on an NVIDIA RTX 2000 Ada under Ubuntu. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions (current `main` 7d9a2fc713 merged in; #9431 is merged; searched open boykopovar/AnyPS5 PRs for padded depth, depth extent and `DB_DEPTH_SIZE` on 2026-10-22) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#9431 is merged) - [x] Fixes: none - [x] Unblocks: CUSA04865 #7941 - [x] GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200) - [x] AI-assisted: yes
fogydes commented 2026-10-22 08:47:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:47:27Z.


Reviewed; the crop itself is right. The cropped gate narrows properly (2D, level 0, lastLevel == 0, baseArray == 0, not stencil, host format equal to the base's, extents within the padded extent, pitch identity when a guest pitch is known), and the crop is a genuine top-left crop: the copy image is created at the sampled view's extent and the surface→staging/staging→copy regions use exactly {extent.width, extent.height, 1}, so texel (x,y) of the T# reads depth texel (x,y) — matching what the body claims. Exact views and PS5 targets fall to the old gate, and the planes predicate correctly drops the terms the new top-of-function baseLevel check already enforces. Both image_sample_lz and image_load paths and D32/D16, edge and recheck cases are covered by the execution test.

Two things worth recording before merge (either in the debt entry or the body):

  1. The GCN-pitch half of the headline fix (resource.gcnPitch == base.extent.width) has no in-repo test — tests/execution/GcnPaddedDepthSampling.cpp binds a PS5-style T# because the harness has no GCN T# decode, so that branch is validated only by the title run. The body discloses this, but it's the PR's own integration point; if a harness path to decode a GCN T# becomes available, that's the first case to add. As it stands the gate also accepts resource.gcnPitch == 0 (an RDNA-styled T# over a PS4 depth base crops purely on host/plain-extent identity) — deliberate per the body, but the pitch-identity claim in the title is only about the gcnPitch branch, which is worth spelling out.

  2. The gate doesn't compare resource.tileMode (or the DB tile mode) against the depth surface's — for the guest-memory fill path the detiler uses resource.tileMode while the copy compares against base's properties. The same exposure predates this change for exact views, so it's not a regression; noting it because the crop gate is where the two descriptor families meet.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336664312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#issuecomment-6336664312). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-22T08:47:27Z. --- Reviewed; the crop itself is right. The `cropped` gate narrows properly (2D, level 0, `lastLevel == 0`, `baseArray == 0`, not stencil, host format equal to the base's, extents within the padded extent, pitch identity when a guest pitch is known), and the crop is a genuine top-left crop: the copy image is created at the sampled view's extent and the surface→staging/staging→copy regions use exactly `{extent.width, extent.height, 1}`, so texel (x,y) of the T# reads depth texel (x,y) — matching what the body claims. Exact views and PS5 targets fall to the old gate, and the `planes` predicate correctly drops the terms the new top-of-function `baseLevel` check already enforces. Both `image_sample_lz` and `image_load` paths and D32/D16, edge and recheck cases are covered by the execution test. Two things worth recording before merge (either in the debt entry or the body): 1. The GCN-pitch half of the headline fix (`resource.gcnPitch == base.extent.width`) has no in-repo test — `tests/execution/GcnPaddedDepthSampling.cpp` binds a PS5-style T# because the harness has no GCN T# decode, so that branch is validated only by the title run. The body discloses this, but it's the PR's own integration point; if a harness path to decode a GCN T# becomes available, that's the first case to add. As it stands the gate also accepts `resource.gcnPitch == 0` (an RDNA-styled T# over a PS4 depth base crops purely on host/plain-extent identity) — deliberate per the body, but the pitch-identity claim in the title is only about the gcnPitch branch, which is worth spelling out. 2. The gate doesn't compare `resource.tileMode` (or the DB tile mode) against the depth surface's — for the guest-memory fill path the detiler uses `resource.tileMode` while the copy compares against `base`'s properties. The same exposure predates this change for exact views, so it's not a regression; noting it because the crop gate is where the two descriptor families meet.
MarcZX10 commented 2026-10-22 08:58:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T08:58:47Z.

Review: CHANGES_REQUESTED


The isolated fix is narrowly gated to PS4 GCN depth targets and a smaller level-0 2D depth-plane view, and the new test exercises D16/D32, crop edges, clamp behavior, redraw refresh, and the unmodified failure path. The PR reports a useful Gang Beasts reproduction and broad depth-test coverage. The hosted conventions/intake/labels checks pass, and git diff --check passes for the fetched head.

The branch is currently CONFLICTING with main; its declared dependency #9431 is also conflicting, and the PR notes a debt-file conflict. Please coordinate/rebase after #9431 is resolved and rerun checks on the current merge commit.

Because this changes the AGC driver, CONTRIBUTING requires paired focused tests on main and the change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1, using ctest -V on the same machine/GPU. Please confirm the requested layer loaded, compare both logs for new VUID- errors, and record the GPU on the checklist. The reported Windows/NVIDIA test runs are extensive, but the PR does not include this required paired validation-layer comparison.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611672920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5611672920). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T08:58:47Z. **Review:** CHANGES_REQUESTED --- The isolated fix is narrowly gated to PS4 GCN depth targets and a smaller level-0 2D depth-plane view, and the new test exercises D16/D32, crop edges, clamp behavior, redraw refresh, and the unmodified failure path. The PR reports a useful Gang Beasts reproduction and broad depth-test coverage. The hosted conventions/intake/labels checks pass, and `git diff --check` passes for the fetched head. The branch is currently `CONFLICTING` with `main`; its declared dependency #9431 is also conflicting, and the PR notes a debt-file conflict. Please coordinate/rebase after #9431 is resolved and rerun checks on the current merge commit. Because this changes the AGC driver, CONTRIBUTING requires paired focused tests on `main` and the change with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, and `ANYPS5_REQUIRE_VULKAN=1`, using `ctest -V` on the same machine/GPU. Please confirm the requested layer loaded, compare both logs for new `VUID-` errors, and record the GPU on the checklist. The reported Windows/NVIDIA test runs are extensive, but the PR does not include this required paired validation-layer comparison.
ntamas94 commented 2026-10-22 10:13:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T10:13:50Z.


Thanks. The branch conflicts with main only through #9431's Graphics/src/State.cpp and, for this commit, the "Depth plane copies" debt entry that main rewrote; I will rebase as soon as Get-fix has rebased #9431 and rerun the checks on the new merge commit. Paired validation-layer run, now in the description: main (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (78 and 64 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6338281652 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#issuecomment-6338281652). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T10:13:50Z. --- Thanks. The branch conflicts with `main` only through #9431's `Graphics/src/State.cpp` and, for this commit, the "Depth plane copies" debt entry that `main` rewrote; I will rebase as soon as Get-fix has rebased #9431 and rerun the checks on the new merge commit. Paired validation-layer run, now in the description: `main` (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (78 and 64 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-22 12:32:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:32:05Z.

Review: COMMENTED


The updated report addresses the paired validation-layer evidence requested earlier: it identifies the same RTX 2080/driver/Windows setup, confirms the layer was loaded, and reports no new VUIDs. The focused regression covers D16/D32 views, crop edges, clamping and redraw refresh, and the author reports the broader depth tests and Gang Beasts run.

The remaining issue is the dependency stack. This branch is still based on #9431, which conflicts with current main, and the reported before/after validation uses main 7e2ba73e4 while current main has advanced. Please coordinate and rebase once #9431 is current, then rerun the focused depth sampling tests and current-main comparison on the resulting merge commit. The Gang Beasts report is from the earlier Get-fix branch, so please confirm the affected current-main path and update the bring-up discussion if the furthest point or blocker changes. I did not run a local C++ build because this checkout has no configured build tree and the filesystem is full.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614164742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5614164742). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:32:05Z. **Review:** COMMENTED --- The updated report addresses the paired validation-layer evidence requested earlier: it identifies the same RTX 2080/driver/Windows setup, confirms the layer was loaded, and reports no new VUIDs. The focused regression covers D16/D32 views, crop edges, clamping and redraw refresh, and the author reports the broader depth tests and Gang Beasts run. The remaining issue is the dependency stack. This branch is still based on #9431, which conflicts with current main, and the reported before/after validation uses main 7e2ba73e4 while current main has advanced. Please coordinate and rebase once #9431 is current, then rerun the focused depth sampling tests and current-main comparison on the resulting merge commit. The Gang Beasts report is from the earlier Get-fix branch, so please confirm the affected current-main path and update the bring-up discussion if the furthest point or blocker changes. I did not run a local C++ build because this checkout has no configured build tree and the filesystem is full.
ntamas94 commented 2026-10-22 13:21:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T13:21:53Z.


Rebased onto #9431's new head (26d651d3e, on main 7e2ba73e4); the commit applied without conflicts, the debt sentence merged into the current "PS4 render targets and display buffers" entry, and "Depth plane copies" is untouched. The 28 depth and graphics tests pass on the new base. Paired validation-layer run, now in the description: main (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and VK_LOADER_DEBUG=warn,error, ctest -V, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's adding layers "VK_LAYER_KHRONOS_validation" line (78 and 66 times) and neither reports was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- ids on main: 0, on this branch: 0, new on this branch: 0.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341814368 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#issuecomment-6341814368). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T13:21:53Z. --- Rebased onto #9431's new head (`26d651d3e`, on `main` `7e2ba73e4`); the commit applied without conflicts, the debt sentence merged into the current "PS4 render targets and display buffers" entry, and "Depth plane copies" is untouched. The 28 depth and graphics tests pass on the new base. Paired validation-layer run, now in the description: `main` (100% tests passed, main build 7e2ba73e4) and this branch (100% tests passed) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` and `VK_LOADER_DEBUG=warn,error`, `ctest -V`, on the NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200), Vulkan SDK 1.4.363.0: both logs carry the loader's `adding layers "VK_LAYER_KHRONOS_validation"` line (78 and 66 times) and neither reports `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` ids on `main`: 0, on this branch: 0, new on this branch: 0. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
XairRrR commented 2026-10-29 10:43:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T10:43:44Z.

Review: APPROVED


Reviewed — approved

The crop merges cleanly into current main, builds, passes the new test and the depth tests with the validation layer loaded and no new VUID- lines, and the new test fails with the production change reverted; one non-blocking note about the test-only gcnPitch == 0 clause.

What I ran

  • PR head: 43497e2a964d861222522467c363e5e7b3051cf1
  • main: 1db077e876a839f75d11a56e728e7f56a4a8c25e
  • Merge commit tested: main + head, --no-ff, no conflicts (docs/dev/debt/libSceAgcDriver.md auto-merged)
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08); Release, Ninja, BUILD_TESTING=ON, in a clean worktree
git fetch origin main pull/9672/head:refs/review/9672
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/9672
git diff --check origin/main...refs/review/9672
python3 tools/check_conventions.py --base origin/main

cmake --build build -j10 \
  --target agc_driver_gcn_padded_depth_sampling_tests agc_driver_depth_plane_sampling_tests \
  --target agc_driver_depth_plane_guest_layers_tests agc_driver_depth_plane_buffer_memory_tests \
  --target agc_driver_depth_plane_fill_tests agc_driver_depth_plane_partial_store_tests \
  --target agc_driver_depth_compare_copy_tests agc_driver_depth_storage_tests \
  --target agc_driver_depth_storage_reuse_tests agc_driver_depth_storage_dispatch_tests \
  --target agc_driver_depth_surface_from_storage_tests agc_driver_depth_surface_last_writer_tests \
  --target agc_driver_depth_bits_guest_memory_tests agc_driver_depth_fast_clear_tests \
  --target agc_driver_gcn_detile_tests agc_driver_stencil_replay_tests \
  --target agc_driver_native_multisample_depth_tests agc_driver_depth_htile_write_tests

VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
VK_LOADER_DEBUG=error,warn,layer \
ctest --test-dir build -j4 -V --output-on-failure -R \
  'agc_driver_(gcn_padded_depth_sampling|depth_plane|depth_storage|depth_surface|depth_compare_copy|depth_bits_guest_memory|depth_fast_clear$|depth_htile_write|gcn_detile$|stencil_replay$|native_multisample_depth$)'

# the same build (without the new test target) and the same ctest command on origin/main

# negative control
git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp \
                            core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
cmake --build build -j10 --target agc_driver_gcn_padded_depth_sampling_tests
ctest --test-dir build -R 'agc_driver_gcn_padded_depth_sampling$' --output-on-failure

Results

Check Result
Merge into main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build (targets above) OK on the merge and on main
Focused tests, merge 25/25 passed; agc_driver_gcn_padded_depth_sampling 0.47 s
Focused tests, main 24/24 passed (same set without the new test)
Validation layer loaded Insert instance layer "VK_LAYER_KHRONOS_validation": 29 lines (merge), 28 (main)
was not found but was requested by env var VK_INSTANCE_LAYERS 0 on both
VUID- lines 0 on main, 0 on the merge, so none new
Negative control New test fails (see below)
CI on the head windows, conventions, labels, eligibility, report succeeded (a second conventions run was cancelled); linux, relinker, relinker-asan, write-watch and register-context were skipped
ctest on the merge (excerpt)
 9/25 Test  #864: agc_driver_depth_plane_sampling_evicting .................   Passed    0.85 sec
10/25 Test #1285: agc_driver_native_multisample_depth ......................   Passed    2.19 sec
15/25 Test #1013: agc_driver_depth_plane_sampling ..........................   Passed    0.65 sec
17/25 Test #1129: agc_driver_gcn_padded_depth_sampling .....................   Passed    0.47 sec
19/25 Test #1530: agc_driver_depth_storage_reuse_draw_pipeline .............   Passed    0.47 sec
21/25 Test #1695: agc_driver_depth_plane_cpu_write_after_page_unwatch ......   Passed    0.58 sec
25/25 Test #1699: agc_driver_depth_plane_partial_store_buffer_copy .........   Passed    0.38 sec
100% tests passed out of 25

Negative control

I restored Graphics/src/DepthSurface.cpp and Graphics/src/State.cpp from main and kept the DepthTarget::gcn field in State.hpp, because the test sets it. With that tree, agc_driver_gcn_padded_depth_sampling fails on its first probe, as the description says:

output
AGC graphics: D32 64x64 PS4 depth through a 48x40 R32F view, image_sample_lz thread 0 at texel (0,0) of the 48x40 view: read 0.00000000, expected 0.25000000
0% tests passed, 1 tests failed out of 1

With the merged files restored, it passes again.

Findings

Blocking

None.

Non-blocking

  1. The gcnPitch == 0 arm of the crop gate only runs in the test, and the production arm has no test. fogydes already raised this; here is new evidence that the two arms never overlap.

    • DepthTarget::gcn is set from ShaderRecompiler::GcnGuestShaders() (State.cpp:453-454).
    • The T# decoder reads the same global flag and, when it is set, always fills gcnPitch and requires gcnPitch >= width, so the pitch is never 0 (GuestTextureResource.cpp:312-315).
    • So in a running PS4 title, base.gcn && resource.gcnPitch == 0 cannot happen, and the resource.gcnPitch == 0 || term in cropped (DepthSurface.cpp:2509) exists only for the test.
    • The test reaches it by setting state.depth->gcn = true by hand (GcnPaddedDepthSampling.cpp:173) over an RDNA T#.
    • The arm Gang Beasts takes, resource.gcnPitch == base.extent.width, is therefore covered only by the title run. Nothing in the repository would catch a pitch-unit mismatch between DB_DEPTH_SIZE and the T# pitch.

    The execution harness can already switch to GCN guest mode: GcnBufferFormatLookup.cpp calls ShaderRecompiler::SetGcnGuestShaders(true) after opening the device (GcnBufferFormatLookup.cpp:172). That needs GCN-encoded shader code, so it is more work than the current test. Suggested follow-up:

    • add a case that dispatches GCN code over a GCN T# with pitch 64 (matches, so the crop is taken) and with another pitch (falls back to guest memory);
    • then drop the resource.gcnPitch == 0 || term, so that the gate only accepts what a PS4 title can produce.

    If that is out of scope here, please add one sentence to the debt entry saying the GCN-pitch arm is checked only by a title run.

Not verified

  • The Gang Beasts (CUSA04865) run and the visual claims (dot grid, blur, shadows). I did not launch any title.
  • The Windows build and run from the description. I only ran Linux/NVIDIA.
  • Behaviour with a real GCN T# decoded in GCN guest mode, which the in-repo test does not cover (see the finding).
  • Depth-plane-copy memory under the APS5_DEPTH_PLANE_COPY_MIB budget when a title keeps both a cropped and a full-size copy of one target. agc_driver_depth_plane_sampling_evicting passes, but it does not include a cropped view.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696419487 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5696419487). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T10:43:44Z. **Review:** APPROVED --- # Reviewed — approved The crop merges cleanly into current `main`, builds, passes the new test and the depth tests with the validation layer loaded and no new `VUID-` lines, and the new test fails with the production change reverted; one non-blocking note about the test-only `gcnPitch == 0` clause. ## What I ran - PR head: `43497e2a964d861222522467c363e5e7b3051cf1` - `main`: `1db077e876a839f75d11a56e728e7f56a4a8c25e` - Merge commit tested: `main` + head, `--no-ff`, no conflicts (`docs/dev/debt/libSceAgcDriver.md` auto-merged) - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08); Release, Ninja, `BUILD_TESTING=ON`, in a clean worktree ```sh git fetch origin main pull/9672/head:refs/review/9672 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/9672 git diff --check origin/main...refs/review/9672 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 \ --target agc_driver_gcn_padded_depth_sampling_tests agc_driver_depth_plane_sampling_tests \ --target agc_driver_depth_plane_guest_layers_tests agc_driver_depth_plane_buffer_memory_tests \ --target agc_driver_depth_plane_fill_tests agc_driver_depth_plane_partial_store_tests \ --target agc_driver_depth_compare_copy_tests agc_driver_depth_storage_tests \ --target agc_driver_depth_storage_reuse_tests agc_driver_depth_storage_dispatch_tests \ --target agc_driver_depth_surface_from_storage_tests agc_driver_depth_surface_last_writer_tests \ --target agc_driver_depth_bits_guest_memory_tests agc_driver_depth_fast_clear_tests \ --target agc_driver_gcn_detile_tests agc_driver_stencil_replay_tests \ --target agc_driver_native_multisample_depth_tests agc_driver_depth_htile_write_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j4 -V --output-on-failure -R \ 'agc_driver_(gcn_padded_depth_sampling|depth_plane|depth_storage|depth_surface|depth_compare_copy|depth_bits_guest_memory|depth_fast_clear$|depth_htile_write|gcn_detile$|stencil_replay$|native_multisample_depth$)' # the same build (without the new test target) and the same ctest command on origin/main # negative control git checkout origin/main -- core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp \ core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp cmake --build build -j10 --target agc_driver_gcn_padded_depth_sampling_tests ctest --test-dir build -R 'agc_driver_gcn_padded_depth_sampling$' --output-on-failure ``` ## Results | Check | Result | |---|---| | Merge into `main` | Clean | | `git diff --check` | Clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build (targets above) | OK on the merge and on `main` | | Focused tests, merge | 25/25 passed; `agc_driver_gcn_padded_depth_sampling` 0.47 s | | Focused tests, `main` | 24/24 passed (same set without the new test) | | Validation layer loaded | `Insert instance layer "VK_LAYER_KHRONOS_validation"`: 29 lines (merge), 28 (`main`) | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | 0 on both | | `VUID-` lines | 0 on `main`, 0 on the merge, so none new | | Negative control | New test fails (see below) | | CI on the head | `windows`, `conventions`, `labels`, `eligibility`, `report` succeeded (a second `conventions` run was cancelled); `linux`, `relinker`, `relinker-asan`, `write-watch` and `register-context` were skipped | <details><summary>ctest on the merge (excerpt)</summary> ``` 9/25 Test #864: agc_driver_depth_plane_sampling_evicting ................. Passed 0.85 sec 10/25 Test #1285: agc_driver_native_multisample_depth ...................... Passed 2.19 sec 15/25 Test #1013: agc_driver_depth_plane_sampling .......................... Passed 0.65 sec 17/25 Test #1129: agc_driver_gcn_padded_depth_sampling ..................... Passed 0.47 sec 19/25 Test #1530: agc_driver_depth_storage_reuse_draw_pipeline ............. Passed 0.47 sec 21/25 Test #1695: agc_driver_depth_plane_cpu_write_after_page_unwatch ...... Passed 0.58 sec 25/25 Test #1699: agc_driver_depth_plane_partial_store_buffer_copy ......... Passed 0.38 sec 100% tests passed out of 25 ``` </details> ## Negative control I restored `Graphics/src/DepthSurface.cpp` and `Graphics/src/State.cpp` from `main` and kept the `DepthTarget::gcn` field in `State.hpp`, because the test sets it. With that tree, `agc_driver_gcn_padded_depth_sampling` fails on its first probe, as the description says: <details><summary>output</summary> ``` AGC graphics: D32 64x64 PS4 depth through a 48x40 R32F view, image_sample_lz thread 0 at texel (0,0) of the 48x40 view: read 0.00000000, expected 0.25000000 0% tests passed, 1 tests failed out of 1 ``` </details> With the merged files restored, it passes again. ## Findings ### Blocking None. ### Non-blocking 1. **The `gcnPitch == 0` arm of the crop gate only runs in the test, and the production arm has no test.** fogydes already raised this; here is new evidence that the two arms never overlap. - `DepthTarget::gcn` is set from `ShaderRecompiler::GcnGuestShaders()` ([State.cpp:453-454](https://github.com/boykopovar/AnyPS5/blob/43497e2a964d861222522467c363e5e7b3051cf1/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L453-L454)). - The T# decoder reads the same global flag and, when it is set, always fills `gcnPitch` and requires `gcnPitch >= width`, so the pitch is never 0 ([GuestTextureResource.cpp:312-315](https://github.com/boykopovar/AnyPS5/blob/43497e2a964d861222522467c363e5e7b3051cf1/core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp#L312-L315)). - So in a running PS4 title, `base.gcn && resource.gcnPitch == 0` cannot happen, and the `resource.gcnPitch == 0 ||` term in `cropped` ([DepthSurface.cpp:2509](https://github.com/boykopovar/AnyPS5/blob/43497e2a964d861222522467c363e5e7b3051cf1/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L2509)) exists only for the test. - The test reaches it by setting `state.depth->gcn = true` by hand ([GcnPaddedDepthSampling.cpp:173](https://github.com/boykopovar/AnyPS5/blob/43497e2a964d861222522467c363e5e7b3051cf1/core/libs/prx/libSceAgcDriver/tests/execution/GcnPaddedDepthSampling.cpp#L173)) over an RDNA T#. - The arm Gang Beasts takes, `resource.gcnPitch == base.extent.width`, is therefore covered only by the title run. Nothing in the repository would catch a pitch-unit mismatch between `DB_DEPTH_SIZE` and the T# pitch. The execution harness can already switch to GCN guest mode: `GcnBufferFormatLookup.cpp` calls `ShaderRecompiler::SetGcnGuestShaders(true)` after opening the device ([GcnBufferFormatLookup.cpp:172](https://github.com/boykopovar/AnyPS5/blob/1db077e876a839f75d11a56e728e7f56a4a8c25e/core/libs/prx/libSceAgcDriver/tests/execution/GcnBufferFormatLookup.cpp#L172)). That needs GCN-encoded shader code, so it is more work than the current test. Suggested follow-up: - add a case that dispatches GCN code over a GCN T# with pitch 64 (matches, so the crop is taken) and with another pitch (falls back to guest memory); - then drop the `resource.gcnPitch == 0 ||` term, so that the gate only accepts what a PS4 title can produce. If that is out of scope here, please add one sentence to the debt entry saying the GCN-pitch arm is checked only by a title run. ## Not verified - The Gang Beasts (CUSA04865) run and the visual claims (dot grid, blur, shadows). I did not launch any title. - The Windows build and run from the description. I only ran Linux/NVIDIA. - Behaviour with a real GCN T# decoded in GCN guest mode, which the in-repo test does not cover (see the finding). - Depth-plane-copy memory under the `APS5_DEPTH_PLANE_COPY_MIB` budget when a title keeps both a cropped and a full-size copy of one target. `agc_driver_depth_plane_sampling_evicting` passes, but it does not include a cropped view.
MarcZX10 commented 2026-10-29 11:08:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:08:00Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new report addresses the prior merge conflict and gives 22 depth tests three times each, paired validation-layer results, and conventions on head 43497e2a96. The branch is still based on f7e84c4cf1; current main is ba5b5330b3. Current-main changes overlap the debt entry, and the repository requires the current main base. Please merge current main, run the focused depth tests and validation comparison on the resulting exact head, and update the report. The Gang Beasts result is correctly labeled historical; it does not substitute for current-head performance evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696707711 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5696707711). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T11:08:00Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested The new report addresses the prior merge conflict and gives 22 depth tests three times each, paired validation-layer results, and conventions on head `43497e2a96`. The branch is still based on `f7e84c4cf1`; current `main` is `ba5b5330b3`. Current-main changes overlap the debt entry, and the repository requires the current main base. Please merge current main, run the focused depth tests and validation comparison on the resulting exact head, and update the report. The Gang Beasts result is correctly labeled historical; it does not substitute for current-head performance evidence.
MarcZX10 commented 2026-10-29 21:23:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:23:05Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The new depth-test report covers head c599331a9b9e575a1458c75def9b03acd9d0cfb6 against main 951f374c87, but that branch does not include live main c40cef843681418b4d66df2939a92ba8ba6ba5d9 as required by the contribution rules.

What I ran

Compared exact PR head c599331a9b9e575a1458c75def9b03acd9d0cfb6 against live main c40cef843681418b4d66df2939a92ba8ba6ba5d9 on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I did not build or run GPU tests locally.

git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-9672-head
git diff --check refs/remotes/upstream/main...refs/review/pr-9672-head
gh pr checks 9672 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview with live main Clean; the PR head still needs to be updated onto current main
git diff --check Passed; no output
Hosted checks Conventions, labels, report, eligibility and Windows pass; Linux and specialized jobs are skipped
Focused depth/Vulkan tests Author reports 22 depth tests passing three times and a paired validation-layer run against 951f374c87; not independently run here
Unedited command output
e3b8055ddabb177359037eeb9f9fbb4a5f4ecac2

git diff --check produced no output and exited successfully.

Findings

Blocking

  • The PR is not based on current main. The author’s refreshed tests cover the branch merged with 951f374c87, while live main is now c40cef843681418b4d66df2939a92ba8ba6ba5d9. The merge preview is clean, but CONTRIBUTING.md requires one branch based on current main. Please update the branch and refresh the exact-head test report before approval.

Non-blocking

  • The latest report adds useful coverage for stencil_plane_memory and describes the DepthSurfaceTexture::planes conflict resolution. I did not independently run those tests or verify GPU behavior.

Sources

Not verified

I did not run the focused tests, a local build, Vulkan validation, or a console/title run. The author’s test results are reported, not independently confirmed.

To get this to a good state

Update onto live main, rerun the same focused depth and validation-layer checks on the resulting exact head and base, and refresh the report. I will rerun the merge preview, whitespace check, and relevant tests against that new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705150886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5705150886). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:23:05Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The new depth-test report covers head `c599331a9b9e575a1458c75def9b03acd9d0cfb6` against `main` `951f374c87`, but that branch does not include live `main` `c40cef843681418b4d66df2939a92ba8ba6ba5d9` as required by the contribution rules. ## What I ran Compared exact PR head `c599331a9b9e575a1458c75def9b03acd9d0cfb6` against live `main` `c40cef843681418b4d66df2939a92ba8ba6ba5d9` on Linux x86-64 using Git and GitHub CLI. The merge preview is clean. I did not build or run GPU tests locally. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-9672-head git diff --check refs/remotes/upstream/main...refs/review/pr-9672-head gh pr checks 9672 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview with live `main` | Clean; the PR head still needs to be updated onto current `main` | | `git diff --check` | Passed; no output | | Hosted checks | Conventions, labels, report, eligibility and Windows pass; Linux and specialized jobs are skipped | | Focused depth/Vulkan tests | Author reports 22 depth tests passing three times and a paired validation-layer run against `951f374c87`; not independently run here | <details><summary>Unedited command output</summary> ```text e3b8055ddabb177359037eeb9f9fbb4a5f4ecac2 ``` `git diff --check` produced no output and exited successfully. </details> ## Findings ### Blocking - **The PR is not based on current `main`.** The author’s refreshed tests cover the branch merged with `951f374c87`, while live `main` is now `c40cef843681418b4d66df2939a92ba8ba6ba5d9`. The merge preview is clean, but `CONTRIBUTING.md` requires one branch based on current `main`. Please update the branch and refresh the exact-head test report before approval. ### Non-blocking - The latest report adds useful coverage for `stencil_plane_memory` and describes the `DepthSurfaceTexture::planes` conflict resolution. I did not independently run those tests or verify GPU behavior. ## Sources - [Contribution rule at `c40cef843681418b4d66df2939a92ba8ba6ba5d9`](https://github.com/boykopovar/AnyPS5/blob/c40cef843681418b4d66df2939a92ba8ba6ba5d9/CONTRIBUTING.md#L57) - [PR changes at `c599331a9b9e575a1458c75def9b03acd9d0cfb6`](https://github.com/boykopovar/AnyPS5/tree/c599331a9b9e575a1458c75def9b03acd9d0cfb6) ## Not verified I did not run the focused tests, a local build, Vulkan validation, or a console/title run. The author’s test results are reported, not independently confirmed. ## To get this to a good state Update onto live `main`, rerun the same focused depth and validation-layer checks on the resulting exact head and base, and refresh the report. I will rerun the merge preview, whitespace check, and relevant tests against that new head.
XairRrR commented 2026-11-03 10:38:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T10:38:36Z.

Review: APPROVED


Re-checked — approved

Since my review of 43497e2a96, the branch has taken several merges of main (the latest is d8d638d5af) and f8bc6ebb92, which shortens this PR's sentence in the debt entry. The PR's own code is unchanged, the merge builds and passes, and the negative control still fails as it should.

What changed since my last review

  • Code: none. The range-diff shows 244e1da99b is unchanged. The PR's code diff against main is still the same:
    • the DepthTarget::gcn field and the line that sets it;
    • the exact/cropped gate and the view-sized plane copy key and extent in DepthSurfaceTexture;
    • the new execution test.
  • Merge resolutions: the merges of main touch the planes line and the stale check right below it. The merged lines keep main's cube-array rule and the OverwrittenInMemory() || OverwrittenOnGpu() check, and drop only the exact-extent and baseLevel terms. The baseLevel check now happens earlier in the function.
  • Debt entry: f8bc6ebb92 shortens this PR's sentence in "PS4 render targets and display buffers" so the entry stays under the length limit. main's text in it is unchanged.
  • Description: now names main 7d9a2fc713 for the author's runs. It adds TechLevelZero's NVIDIA CI on 43497e2a96. RNK123 also posted an AMD/RADV run on f8bc6ebb92 (author-reported by them, not checked by me).

What I ran

  • PR head d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343
  • main 4f41f4c375f5abb487dbd184fbc150f31994d762
  • merged tree e0ab1c3b17ea3d18e2f157456f87ee00ceeb74d4
  • Debian 13 VM, GCC 14.2.0, lavapipe (Mesa 26.1.6)
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762

env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_(native_depth_uniform_planes|gcn_padded_depth_sampling)$'

# negative control (State.hpp kept: the test sets DepthTarget::gcn)
git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
ninja -C build agc_driver_gcn_padded_depth_sampling_tests agc_driver_native_multisample_depth_tests
# same validation-layer ctest command as above

# restore the merged files from e0ab1c3b17, rebuild the same targets
git status --porcelain
ctest --test-dir build --output-on-failure -R '^agc_driver_(gcn_padded_depth_sampling|depth_plane_sampling.*|native_depth_uniform_planes)$'
Check Result
git diff --check clean
check_conventions.py All conventions checks passed.
Build (script) OK
Selected tests (script) 2,171 ran, 0 new failures, 0 timeouts. The 7 known failures fail on main too.
agc_driver_gcn_padded_depth_sampling Passed (0.91 s with the validation layer)
depth_plane_sampling*, native_depth_uniform_planes Passed (the longest took 5.7 s)
Validation (script) 770 of 771 tests loaded the layer. There is one "new" VUID in agc_driver_native_depth_uniform_planes; it comes from main (see below).
Worktree after restore git status --porcelain empty

The agc_driver_native_depth_uniform_planes VUID comes from main, not from this PR. The script flagged VUID-vkCmdDispatch-groupCountX-00386 there, marked "test not run on main": the baseline (d1ae628bc2) is older than the test. I ran the test with DepthSurface.cpp and State.cpp restored from main 4f41f4c375. It reports the same 8 VUID-vkCmdDispatch-groupCountX-00386 lines as on the merged tree, so I do not count it against this PR.

Negative control

With DepthSurface.cpp and State.cpp restored from main, the new test fails on its first probe:

output
AGC graphics: D32 64x64 PS4 depth through a 48x40 R32F view, image_sample_lz thread 0 at texel (0,0) of the 48x40 view: read 0.00000000, expected 0.25000000
1/2 Test #1193: agc_driver_gcn_padded_depth_sampling .....***Failed    0.39 sec

With the merged files restored, it passes again.

Previous findings

  • Still open (non-blocking): the gcnPitch == 0 arm of the crop gate runs only in the test, and the gcnPitch == base.extent.width arm has no test. The gate at DepthSurface.cpp:3082 is unchanged. The shortened debt sentence at libSceAgcDriver.md:119 does not say that the GCN-pitch arm is checked only by a title run. This does not block a merge; the earlier suggestions still apply: a GCN-mode test case, or one sentence in the debt entry.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The Gang Beasts (CUSA04865) run and the visual claims; I did not launch a title.
  • The author's Windows/NVIDIA runs and the RADV run (both reported by others).
  • Behaviour with a real GCN T# decoded in GCN guest mode; no in-repo test covers it.
  • I did not run the full depth-test list again myself. The script's selected run covered the tests this change reaches.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5750693245 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9672#pullrequestreview-5750693245). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T10:38:36Z. **Review:** APPROVED --- # Re-checked — approved Since my review of `43497e2a96`, the branch has taken several merges of `main` (the latest is `d8d638d5af`) and `f8bc6ebb92`, which shortens this PR's sentence in the debt entry. The PR's own code is unchanged, the merge builds and passes, and the negative control still fails as it should. ## What changed since my last review - **Code:** none. The range-diff shows `244e1da99b` is unchanged. The PR's code diff against `main` is still the same: - the `DepthTarget::gcn` field and the line that sets it; - the `exact`/`cropped` gate and the view-sized plane copy key and extent in `DepthSurfaceTexture`; - the new execution test. - **Merge resolutions:** the merges of `main` touch the `planes` line and the stale check right below it. The merged lines keep `main`'s cube-array rule and the `OverwrittenInMemory() || OverwrittenOnGpu()` check, and drop only the exact-extent and `baseLevel` terms. The `baseLevel` check now happens earlier in the function. - **Debt entry:** `f8bc6ebb92` shortens this PR's sentence in "PS4 render targets and display buffers" so the entry stays under the length limit. `main`'s text in it is unchanged. - **Description:** now names `main` 7d9a2fc713 for the author's runs. It adds TechLevelZero's NVIDIA CI on `43497e2a96`. RNK123 also posted an AMD/RADV run on `f8bc6ebb92` (author-reported by them, not checked by me). ## What I ran - PR head `d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343` - `main` `4f41f4c375f5abb487dbd184fbc150f31994d762` - merged tree `e0ab1c3b17ea3d18e2f157456f87ee00ceeb74d4` - Debian 13 VM, GCC 14.2.0, lavapipe (Mesa 26.1.6) ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R '^agc_driver_(native_depth_uniform_planes|gcn_padded_depth_sampling)$' # negative control (State.hpp kept: the test sets DepthTarget::gcn) git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp ninja -C build agc_driver_gcn_padded_depth_sampling_tests agc_driver_native_multisample_depth_tests # same validation-layer ctest command as above # restore the merged files from e0ab1c3b17, rebuild the same targets git status --porcelain ctest --test-dir build --output-on-failure -R '^agc_driver_(gcn_padded_depth_sampling|depth_plane_sampling.*|native_depth_uniform_planes)$' ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build (script) | OK | | Selected tests (script) | 2,171 ran, 0 new failures, 0 timeouts. The 7 known failures fail on `main` too. | | `agc_driver_gcn_padded_depth_sampling` | Passed (0.91 s with the validation layer) | | `depth_plane_sampling*`, `native_depth_uniform_planes` | Passed (the longest took 5.7 s) | | Validation (script) | 770 of 771 tests loaded the layer. There is one "new" VUID in `agc_driver_native_depth_uniform_planes`; it comes from `main` (see below). | | Worktree after restore | `git status --porcelain` empty | **The `agc_driver_native_depth_uniform_planes` VUID comes from `main`, not from this PR.** The script flagged `VUID-vkCmdDispatch-groupCountX-00386` there, marked "test not run on main": the baseline (`d1ae628bc2`) is older than the test. I ran the test with `DepthSurface.cpp` and `State.cpp` restored from `main` `4f41f4c375`. It reports the same 8 `VUID-vkCmdDispatch-groupCountX-00386` lines as on the merged tree, so I do not count it against this PR. ## Negative control With `DepthSurface.cpp` and `State.cpp` restored from `main`, the new test fails on its first probe: <details><summary>output</summary> ``` AGC graphics: D32 64x64 PS4 depth through a 48x40 R32F view, image_sample_lz thread 0 at texel (0,0) of the 48x40 view: read 0.00000000, expected 0.25000000 1/2 Test #1193: agc_driver_gcn_padded_depth_sampling .....***Failed 0.39 sec ``` </details> With the merged files restored, it passes again. ## Previous findings - **Still open (non-blocking): the `gcnPitch == 0` arm of the crop gate runs only in the test, and the `gcnPitch == base.extent.width` arm has no test.** The gate at [DepthSurface.cpp:3082](https://github.com/boykopovar/AnyPS5/blob/d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L3082) is unchanged. The shortened debt sentence at [libSceAgcDriver.md:119](https://github.com/boykopovar/AnyPS5/blob/d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343/docs/dev/debt/libSceAgcDriver.md#L119) does not say that the GCN-pitch arm is checked only by a title run. This does not block a merge; the earlier suggestions still apply: a GCN-mode test case, or one sentence in the debt entry. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - The Gang Beasts (CUSA04865) run and the visual claims; I did not launch a title. - The author's Windows/NVIDIA runs and the RADV run (both reported by others). - Behaviour with a real GCN T# decoded in GCN guest mode; no in-repo test covers it. - I did not run the full depth-test list again myself. The script's selected run covered the tests this change reaches. <!-- anyps5-bots job=3278 head=d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343 -->
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!9672
No description provided.