feat(agc): render layered draws into a depth view of several slices #7256

Open
gjonn wants to merge 6 commits from upstream-pr/7256 into main
gjonn commented 2026-10-17 19:56:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-17T19:56:10Z.


What

Depends on: #7254. The first four commits of this branch are #7254's (its two changes, the review follow-up fix and its agc_driver_layered_array_color_draw test); this PR's own change is the last commit, feat(agc): render layered draws into a depth view of several slices.

With #7254, PPSA01317 gets through the color side of a 512x512 cube map pass and then aborts with layered rendering with a depth target is unsupported. The draw exports the render target array index into a six-slice color view, with a DB_DEPTH_VIEW of slices 0 to 5.

  • Decode. In a layered draw, the depth view renders as many layers as the color views. A depth-only layered draw renders the view's own slices. A depth view whose slice count differs from the color views throws.
  • Depth surfaces. The depth surfaces of those slices share one single-sample array image, one layer each, and the draw attaches a 2D array view of it. Each slice keeps its own Z, stencil and HTILE address (one DepthSliceBytes and one HtileMetadataBytes further per slice). Each slice also keeps its own plane ownership, HTILE clears and plane copies. A later draw into one slice binds that slice's layer. Another layered view over some of the same slices (another first slice or slice count) is a separate array image that takes each slice by a whole-slice copy when it is bound.
  • A multisampled layered depth target throws, and so does a layered target without a depth plane. The debt file gets a "Layered depth targets" entry, and the color entry no longer lists the depth refusal.

Behaviour change on an existing path: a depth-only layered draw into a multisampled or stencil-only depth view of several slices used to render silently into the first slice. It now throws.

Open debt:

  • The DB clamps a layer index past the view's last slice to SLICE_MAX. That clamp is not modelled; such a layer is undefined in Vulkan.
  • A single-slice color view with a multi-slice depth view stays single-layer (the depth view's first slice), as before.

#7194 changes the same HTILE slice-clear function in DepthSurface.cpp (taking a later slice's clear when every word has ZMask 0). It works per slice and composes with the per-slice HTILE addresses here; the two branches merge without conflicts.

Tested

Windows 11, NVIDIA GeForce RTX 5090 Laptop GPU, driver 616.92. Ninja/MinGW Release with BUILD_TESTING=ON, on top of #7254 rebased on main 922dc8999.

  • New GPU test agc_driver_layered_depth_target covers a six-layer depth-tested draw:
    • after a draw into slice 2 alone;
    • after per-layer depth fills;
    • after an HTILE clear of slice 4 alone;
    • a single-slice draw into slice 1 after the layered draws;
    • a six-layer draw after a three-layer view of slices 2 to 4;
    • each slice read back as a layer of a 2D array texture.
  • agc_driver_graphics_tests: new decode cases for depth-only layered views, color plus depth views of matching, shifted and mismatched slice counts, and views without the layer export staying single-layer.
  • 29 related tests: 28 pass, and agc_driver_stencil_ref_export is skipped because the device does not support it. The set is the layered depth target, graphics and decode state tests, every depth/HTILE/stencil execution test (agc_driver_depth_*, agc_driver_native_multisample_depth, agc_driver_sample_mask_depth_stencil, agc_driver_stencil_*), the array layer target test and the layered volume and vertex layer export tests.
  • tools/check_conventions.py --base origin/main and tools/check_test_registration.py pass.
  • PPSA01317 gets past this abort on main with #7254 (checked in boots).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed 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: #7254
  • Fixes: none
  • Unblocks: PPSA01317 #4697
  • GPUs tested: NVIDIA GeForce RTX 5090 Laptop GPU, driver 616.92, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4903436053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-17T19:56:10Z. --- ### What **Depends on: #7254.** The first four commits of this branch are #7254's (its two changes, the review follow-up fix and its `agc_driver_layered_array_color_draw` test); this PR's own change is the last commit, `feat(agc): render layered draws into a depth view of several slices`. With #7254, PPSA01317 gets through the color side of a 512x512 cube map pass and then aborts with `layered rendering with a depth target is unsupported`. The draw exports the render target array index into a six-slice color view, with a `DB_DEPTH_VIEW` of slices 0 to 5. - **Decode.** In a layered draw, the depth view renders as many layers as the color views. A depth-only layered draw renders the view's own slices. A depth view whose slice count differs from the color views throws. - **Depth surfaces.** The depth surfaces of those slices share one single-sample array image, one layer each, and the draw attaches a 2D array view of it. Each slice keeps its own Z, stencil and HTILE address (one `DepthSliceBytes` and one `HtileMetadataBytes` further per slice). Each slice also keeps its own plane ownership, HTILE clears and plane copies. A later draw into one slice binds that slice's layer. Another layered view over some of the same slices (another first slice or slice count) is a separate array image that takes each slice by a whole-slice copy when it is bound. - A multisampled layered depth target throws, and so does a layered target without a depth plane. The debt file gets a "Layered depth targets" entry, and the color entry no longer lists the depth refusal. **Behaviour change on an existing path:** a depth-only layered draw into a multisampled or stencil-only depth view of several slices used to render silently into the first slice. It now throws. **Open debt:** - The DB clamps a layer index past the view's last slice to `SLICE_MAX`. That clamp is not modelled; such a layer is undefined in Vulkan. - A single-slice color view with a multi-slice depth view stays single-layer (the depth view's first slice), as before. #7194 changes the same HTILE slice-clear function in `DepthSurface.cpp` (taking a later slice's clear when every word has ZMask 0). It works per slice and composes with the per-slice HTILE addresses here; the two branches merge without conflicts. ### Tested Windows 11, NVIDIA GeForce RTX 5090 Laptop GPU, driver 616.92. Ninja/MinGW Release with `BUILD_TESTING=ON`, on top of #7254 rebased on `main` 922dc8999. - New GPU test `agc_driver_layered_depth_target` covers a six-layer depth-tested draw: - after a draw into slice 2 alone; - after per-layer depth fills; - after an HTILE clear of slice 4 alone; - a single-slice draw into slice 1 after the layered draws; - a six-layer draw after a three-layer view of slices 2 to 4; - each slice read back as a layer of a 2D array texture. - `agc_driver_graphics_tests`: new decode cases for depth-only layered views, color plus depth views of matching, shifted and mismatched slice counts, and views without the layer export staying single-layer. - 29 related tests: 28 pass, and `agc_driver_stencil_ref_export` is skipped because the device does not support it. The set is the layered depth target, graphics and decode state tests, every depth/HTILE/stencil execution test (`agc_driver_depth_*`, `agc_driver_native_multisample_depth`, `agc_driver_sample_mask_depth_stencil`, `agc_driver_stencil_*`), the array layer target test and the layered volume and vertex layer export tests. - `tools/check_conventions.py --base origin/main` and `tools/check_test_registration.py` pass. - PPSA01317 gets past this abort on `main` with #7254 (checked in boots). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed 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: #7254 - [x] Fixes: none - [x] Unblocks: PPSA01317 #4697 - [x] GPUs tested: NVIDIA GeForce RTX 5090 Laptop GPU, driver 616.92, Windows 11 - [x] AI-assisted: yes
gjonn commented 2026-10-17 21:27:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-17T21:27:12Z.


Rebased onto main 5f8d2a252 via the rebased #7254 (force-push, head 558975214). One conflict, in DepthSurface.cpp DepthSurfaceView: #7131 changed the inline bind code to use NoteHtileClear() instead of OR-ing pendingClear, and this PR had moved that code into bindSurface(). I kept bindSurface() and applied the NoteHtileClear() calls inside it, so the HTILE clears drop a pending plane fill for both single and per-slice binds. Each slice keeps its own depthFill/stencilFill, and RecordClear clears only its own layer. Rebuilt; all 666 agc_* tests pass, including agc_driver_layered_depth_target, agc_driver_depth_, agc_driver_stencil_, agc_driver_native_multisample_depth, agc_driver_sample_mask_depth_stencil, agc_driver_layered_array_color_draw and the new agc_driver_depth_plane_fill. check_conventions.py and check_test_registration.py are clean.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241354772 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256#issuecomment-6241354772). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-17T21:27:12Z. --- Rebased onto main 5f8d2a252 via the rebased #7254 (force-push, head 558975214). One conflict, in DepthSurface.cpp DepthSurfaceView: #7131 changed the inline bind code to use NoteHtileClear() instead of OR-ing pendingClear, and this PR had moved that code into bindSurface(). I kept bindSurface() and applied the NoteHtileClear() calls inside it, so the HTILE clears drop a pending plane fill for both single and per-slice binds. Each slice keeps its own depthFill/stencilFill, and RecordClear clears only its own layer. Rebuilt; all 666 agc_* tests pass, including agc_driver_layered_depth_target, agc_driver_depth_*, agc_driver_stencil_*, agc_driver_native_multisample_depth, agc_driver_sample_mask_depth_stencil, agc_driver_layered_array_color_draw and the new agc_driver_depth_plane_fill. check_conventions.py and check_test_registration.py are clean. AI-assisted: yes
frankea commented 2026-10-18 04:15:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T04:15:20Z.


RTX 4090 data point on PPSA01317, on top of my #7254 run (same stack, same box). Short version: with this PR the cube map pass gets through its depth side as well, 3 of 3 runs, and the next stop is the sample of the cube it just rendered: samples a converted float image that is not a 2D or 2D array view, which is #5958's own cube-view rejection and the case #7271 says it handles for format 43.

Setup. Gran Turismo 7 PPSA01317 01.000.001 (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release libs target only (no tests built). app.exe is the relink from main 31cbb55d7 (--windows --registry --module-dir .); only libs/ is swapped between runs. Tree: the #7254 stack (main 5f8d2a252 + #7137 2aa6bfca6 + #7207 ec28b6be8 + #7175 555b7e824 + #5958 87a9b8d28 + #7243 da158d61f + #7238 4aaf27699 + #7240 7c19c66de + #7254 ebe289bdc, 9ea37b61b, see the #7254 comment for the one State.cpp conflict) merged with this PR's head 558975214 (clean, b81f69024). The libSceSsl.prx is the one from #7319 (1f267559e). No controller, no input, nobody at the keyboard; one-shot interactive task per run, 600 s cap, box otherwise idle.

Result. All three runs get past layered rendering with a depth target is unsupported: splash, the black loading screen with the GT spinner (title-bar counter 29 FPS, 1,150 frames at the last capture of run 3), save data mounted, three sceNetResolverStartNtoa -> host DNS lookup failed, 392 further shaders registered, and then, identically every time:

[gpu] driver failure: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
[videoout] presentation failed: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
terminate called after throwing an instance of 'std::runtime_error'
  what():  shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
FATAL: abort() (SIGABRT) on thread 8352

That message is #5958's ResourceMaterializer.cpp reject of a cube or non-2D view on a converted float image, so the pixel shader is now sampling the 10_11_11 float cube map that this PR and #7254 let the title render. No depth-side refusal of any other wording, no depth view whose slice count differs, no device loss.

run shader cache exit after stop
stack without #7256 (#7254 comment, 3 runs) warm 35 to 42 s layered rendering with a depth target is unsupported
1 warm 37 s shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view
2 warm 35 s same
3 warm 35 s same

The chain on this box so far, all on a libs built from the stack above: #6350 crash (#7137) -> sceSslConnect (#7319) -> 11_11_10 blend (#7243) -> dynamic-mip storage image (#7238) -> unnormalized sampler (#7240) -> layered colour view (#7254) -> layered depth view (this PR) -> converted float cube sample.

stderr of run 3 (warm, box idle) from the second 10 s summary to the abort, the 392 per-shader ShaderRegistry lines removed
[log] 10.5 s: 191 lines (19 stdout, 172 stderr), 26.7 KiB written, 0 repeats coalesced; callers spent 0.34 ms queueing and formatting (0.003% of one thread), logger thread 94.14 ms, queue peak 2.2 KiB
[SAVEDATA:native] mount3 user=268435456 dir=DRFILEIV mode=0x1 blocks=673 -> 0x809f0008 point= status=0
[SAVEDATA:native] getMemory2 user=268435456 slot=0 -> 0x00000000
[shader-disk-cache] (10 s): 118 hits, 0 misses, 0 writes (0.0 MiB), 0 load failures, 0 write failures; resource plans: 112 hits, 0 misses, 0 writes, 0 load failures; 12.6 MiB read in 26.2 ms (totals: 1792 hits, 0 misses, 0 writes; plans 1760 hits, 0 misses)
[SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed
[SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed
[SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed
[gpu] driver failure: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
[videoout] presentation failed: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
terminate called after throwing an instance of 'std::runtime_error'
  what():  shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
terminate called after throwing an instance of 'std::runtime_error'
  what():  shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented
FATAL: abort() (SIGABRT) on thread 8352

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245554146 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256#issuecomment-6245554146). Originally posted by [frankea](https://github.com/frankea) on 2026-10-18T04:15:20Z. --- RTX 4090 data point on PPSA01317, on top of my #7254 run (same stack, same box). Short version: with this PR the cube map pass gets through its depth side as well, 3 of 3 runs, and the next stop is the sample of the cube it just rendered: `samples a converted float image that is not a 2D or 2D array view`, which is #5958's own cube-view rejection and the case #7271 says it handles for format 43. **Setup.** Gran Turismo 7 PPSA01317 **01.000.001** (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release `libs` target only (no tests built). `app.exe` is the relink from `main` 31cbb55d7 (`--windows --registry --module-dir .`); only `libs/` is swapped between runs. Tree: the #7254 stack (`main` 5f8d2a252 + #7137 2aa6bfca6 + #7207 ec28b6be8 + #7175 555b7e824 + #5958 87a9b8d28 + #7243 da158d61f + #7238 4aaf27699 + #7240 7c19c66de + #7254 ebe289bdc, 9ea37b61b, see the #7254 comment for the one `State.cpp` conflict) merged with this PR's head 558975214 (clean, b81f69024). The `libSceSsl.prx` is the one from #7319 (1f267559e). No controller, no input, nobody at the keyboard; one-shot interactive task per run, 600 s cap, box otherwise idle. **Result.** All three runs get past `layered rendering with a depth target is unsupported`: splash, the black loading screen with the GT spinner (title-bar counter 29 FPS, 1,150 frames at the last capture of run 3), save data mounted, three `sceNetResolverStartNtoa -> host DNS lookup failed`, 392 further shaders registered, and then, identically every time: ``` [gpu] driver failure: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented [videoout] presentation failed: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented terminate called after throwing an instance of 'std::runtime_error' what(): shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented FATAL: abort() (SIGABRT) on thread 8352 ``` That message is #5958's `ResourceMaterializer.cpp` reject of a cube or non-2D view on a converted float image, so the pixel shader is now sampling the 10_11_11 float cube map that this PR and #7254 let the title render. No depth-side refusal of any other wording, no `depth view whose slice count differs`, no device loss. | run | shader cache | exit after | stop | |---|---|---|---| | stack without #7256 (#7254 comment, 3 runs) | warm | 35 to 42 s | `layered rendering with a depth target is unsupported` | | 1 | warm | 37 s | `shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view` | | 2 | warm | 35 s | same | | 3 | warm | 35 s | same | The chain on this box so far, all on a `libs` built from the stack above: #6350 crash (#7137) -> `sceSslConnect` (#7319) -> 11_11_10 blend (#7243) -> dynamic-mip storage image (#7238) -> unnormalized sampler (#7240) -> layered colour view (#7254) -> layered depth view (this PR) -> converted float cube sample. <details><summary>stderr of run 3 (warm, box idle) from the second 10 s summary to the abort, the 392 per-shader <code>ShaderRegistry</code> lines removed</summary> ```text [log] 10.5 s: 191 lines (19 stdout, 172 stderr), 26.7 KiB written, 0 repeats coalesced; callers spent 0.34 ms queueing and formatting (0.003% of one thread), logger thread 94.14 ms, queue peak 2.2 KiB [SAVEDATA:native] mount3 user=268435456 dir=DRFILEIV mode=0x1 blocks=673 -> 0x809f0008 point= status=0 [SAVEDATA:native] getMemory2 user=268435456 slot=0 -> 0x00000000 [shader-disk-cache] (10 s): 118 hits, 0 misses, 0 writes (0.0 MiB), 0 load failures, 0 write failures; resource plans: 112 hits, 0 misses, 0 writes, 0 load failures; 12.6 MiB read in 26.2 ms (totals: 1792 hits, 0 misses, 0 writes; plans 1760 hits, 0 misses) [SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed [SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed [SOFT-NET] sceNetResolverStartNtoa -> host DNS lookup failed [gpu] driver failure: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented [videoout] presentation failed: shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented terminate called after throwing an instance of 'std::runtime_error' what(): shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented terminate called after throwing an instance of 'std::runtime_error' what(): shader 0x1258d31800 stage 5: samples a converted float image that is not a 2D or 2D array view, which is not implemented FATAL: abort() (SIGABRT) on thread 8352 ``` </details> AI-assisted: yes (Claude Code)
XairRrR commented 2026-10-29 05:10:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T05:10:40Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The layered depth path builds and its tests pass at the PR head. But the branch no longer merges into current main, and a rebase has to rework the code it touches, so the change needs a rebase and a fresh test run.

What I ran

  • PR head: 5589752147fe73b1487bce01b985b83e70f42b15
  • main: 52c09d567d2fa453494dd720fcf53a98149468e4
  • PR merge base: 5f8d2a252437a8dc607f0f52239946bb3f9b22a2

All commands ran in a clean worktree on Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), with a Release, Ninja, BUILD_TESTING=ON build.

git fetch origin main pull/7256/head:refs/review/7256
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/7256        # conflicts, aborted
git checkout --detach refs/review/7256               # submodules synced to the PR's base
git diff --check origin/main...refs/review/7256
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_driver_layered_depth_target_tests agc_driver_graphics_tests \
  agc_driver_layered_array_color_draw_tests agc_driver_array_layer_target_tests agc_driver_depth_*_tests \
  agc_driver_layered_volume_*_tests agc_driver_native_multisample_depth_tests \
  agc_driver_sample_mask_depth_stencil_tests agc_driver_stencil_*_tests libs
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_graphics|agc_driver_array_layer_target|agc_driver_depth_.*|agc_driver_layered_.*|agc_driver_native_multisample_depth|agc_driver_sample_mask_depth_stencil|agc_driver_stencil_.*)$'
# same build and ctest at the merge base 5f8d2a252 (without the two layered tests it lacks)
# negative control: see below

Results

Check Result
Merge into main 52c09d567 Conflicts in 6 files, 20 hunks (see Findings)
git diff --check clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build at PR head (test targets above and libs) OK, no new warnings in the changed files
27 related tests at PR head, with validation 26 passed, agc_driver_stencil_ref_export skipped (this device does not support it)
agc_driver_layered_depth_target Passed, 0.35 s
Same 25 tests at merge base 5f8d2a252 24 passed, the same 1 skipped
VUID- lines, PR head vs merge base 40 vs 40, all VUID-vkBeginCommandBuffer-commandBuffer-00050 from agc_driver_depth_storage and agc_driver_native_multisample_depth; none come from the changed tests, and the PR adds none
was not found but was requested by env var VK_INSTANCE_LAYERS absent from both logs; the loader inserted VK_LAYER_KHRONOS_validation in every test

I compared validation against the PR's merge base, not against main. The merged tree does not exist, and 11,535 commits separate the base from main, so a main run would not isolate this change.

Merge conflicts
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp      (2 hunks)
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp     (9 hunks)
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp             (5 hunks)
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp          (1 hunk)
CONFLICT (content): core/libs/prx/libSceAgcDriver/tests/Graphics.cpp                (2 hunks)
CONFLICT (content): docs/dev/debt/libSceAgcDriver.md                                (1 hunk)
ctest at PR head (excerpt)
525: layered depth target tests passed
16/27 Test #525: agc_driver_layered_depth_target ...........   Passed    0.35 sec
319: Graphics validation tests passed
524: layered array color draw tests passed
100% tests passed out of 27
	654 - agc_driver_stencil_ref_export (Skipped)
Validation messages (same in both runs)
364: Validation Error: [ VUID-vkBeginCommandBuffer-commandBuffer-00050 ] | MessageID = 0xb24f00f5
364: vkBeginCommandBuffer(): VkCommandBuffer ... was recorded and now in the executable state. You must call vkResetCommandBuffer() before calling vkBeginCommandBuffer() again.

20 lines from agc_driver_depth_storage and 20 from agc_driver_native_multisample_depth, at both the PR head and the merge base.

Negative control

At the PR head I restored DepthSurface.cpp, Draw.cpp, State.cpp, Texture.cpp and Texture.hpp from ebe289bdc7, the PR's last commit before its own change. I kept State.hpp (the new DepthTarget::layers field) and the tests, then rebuilt. Both tests fail:

agc_driver_graphics: AGC graphics: layered rendering with a depth target is unsupported
agc_driver_layered_depth_target: AGC graphics: a layered draw after a draw into depth slice 2 alone: slice 1 texel (0, 0) is 0.250000, expected 0.750000 (the depth test of a ramp from 0 to 1 over 32 texels passes on the first 32)

After the run I restored the PR's files.

Findings

Blocking

  1. The branch conflicts with main. This confirms the conflict list in the earlier comment from oneandonlydean: the same six files, 20 hunks. The conflicts touch the code this PR changes. A rebase has to reapply the per-layer logic to code that main has since rewritten:

    • In the depth plane fill on main, the direct image copy and the UNDEFINED -> TRANSFER_DST_OPTIMAL discard barriers hard-code array layer 0 (DepthSurface.cpp#L735-L780 on main). That was correct for a one-layer image. On the shared array image this PR introduces, a fill of slice k would discard and overwrite layer 0, slice 0's contents. All four depth-image subresources there need layer: depthRegion, the destination of copy, and both discard.subresourceRange. The new test should also cover a direct-copy fill of a non-zero slice.
    • The surface constructor on main allocates through AllocateImageMemory (L316). The array != nullptr branch has to keep that path.
    • The depth Texture constructor on main gained a VkImageUsageFlags usage parameter before layerCount. This PR's Sampled() call passes ..., layer, owned, 1u. Rebased as is, that 1u would become usage rather than layerCount.
    • Sampled() on main now goes through the multisample sample shadow (around L481). The layer, 1u arguments must be carried into that call.

    Because the resolved code will differ from what was tested, the GPU results here and in the description need rerunning after the rebase.

Non-blocking

  1. The debt file keeps a contradicting entry. The "HTILE address of a depth array slice" entry (debt line 42 at the PR head, line 76 on main) says decodeDepth does not add the slice offset to htileAddress, so all slices share slice 0's HTILE. But decodeDepth already adds it (State.cpp:310 at the PR head, since 8fec47a4b2). The new "Layered depth targets" entry (line 144) relies on that per-slice HTILE address. The stale entry predates this PR, but this PR now documents the opposite behaviour. Please remove or rewrite it while resolving the debt-file conflict.
  2. The description's dependency is out of date. #7254 was merged on 2026-10-19 from a later head, deb0ba305. This branch still carries its four pre-merge commits. After rebasing, those commits should go, Depends on should read none, and the description should drop "the first four commits of this branch are #7254's".

I found no correctness problem in the PR's own logic at its base. layerTarget steps Z, stencil and HTILE by one slice from the decoded first slice, which matches decodeDepth. The layered image's view is torn down before the surfaces that share its OwnedImage. The unimplemented cases (multisampled, stencil-only, mismatched slice counts) throw.

Not verified

  • A build or tests of the merged tree, because it does not merge.
  • The PPSA01317 claim and the RTX 4090 report in the comments. I did not launch any title.
  • Windows/MinGW builds.
  • agc_driver_stencil_ref_export, which also skips on this device.

To get this to a good state

  1. Rebase onto current main, dropping the pre-merge #7254 commits. Then carry layer through main's direct depth copy, discard barriers, AllocateImageMemory path and sample-shadow Texture construction.
  2. Add a check to agc_driver_layered_depth_target that fills a non-zero slice through the direct depth copy and then reads slice 0 back unchanged.
  3. Remove or rewrite the stale "HTILE address of a depth array slice" debt entry.
  4. Rerun the layered, depth, stencil and graphics tests on the rebased branch, with the validation layer, on main and on the change. Update Depends on to none.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693131404 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256#pullrequestreview-5693131404). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T05:10:40Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The layered depth path builds and its tests pass at the PR head. But the branch no longer merges into current `main`, and a rebase has to rework the code it touches, so the change needs a rebase and a fresh test run. ## What I ran - PR head: `5589752147fe73b1487bce01b985b83e70f42b15` - `main`: `52c09d567d2fa453494dd720fcf53a98149468e4` - PR merge base: `5f8d2a252437a8dc607f0f52239946bb3f9b22a2` All commands ran in a clean worktree on Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), with a Release, Ninja, `BUILD_TESTING=ON` build. ```sh git fetch origin main pull/7256/head:refs/review/7256 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/7256 # conflicts, aborted git checkout --detach refs/review/7256 # submodules synced to the PR's base git diff --check origin/main...refs/review/7256 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target agc_driver_layered_depth_target_tests agc_driver_graphics_tests \ agc_driver_layered_array_color_draw_tests agc_driver_array_layer_target_tests agc_driver_depth_*_tests \ agc_driver_layered_volume_*_tests agc_driver_native_multisample_depth_tests \ agc_driver_sample_mask_depth_stencil_tests agc_driver_stencil_*_tests libs 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_graphics|agc_driver_array_layer_target|agc_driver_depth_.*|agc_driver_layered_.*|agc_driver_native_multisample_depth|agc_driver_sample_mask_depth_stencil|agc_driver_stencil_.*)$' # same build and ctest at the merge base 5f8d2a252 (without the two layered tests it lacks) # negative control: see below ``` ## Results | Check | Result | |---|---| | Merge into `main` 52c09d567 | **Conflicts** in 6 files, 20 hunks (see Findings) | | `git diff --check` | clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build at PR head (test targets above and `libs`) | OK, no new warnings in the changed files | | 27 related tests at PR head, with validation | 26 passed, `agc_driver_stencil_ref_export` skipped (this device does not support it) | | `agc_driver_layered_depth_target` | Passed, 0.35 s | | Same 25 tests at merge base 5f8d2a252 | 24 passed, the same 1 skipped | | `VUID-` lines, PR head vs merge base | 40 vs 40, all `VUID-vkBeginCommandBuffer-commandBuffer-00050` from `agc_driver_depth_storage` and `agc_driver_native_multisample_depth`; none come from the changed tests, and the PR adds none | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent from both logs; the loader inserted `VK_LAYER_KHRONOS_validation` in every test | I compared validation against the PR's merge base, not against `main`. The merged tree does not exist, and 11,535 commits separate the base from `main`, so a `main` run would not isolate this change. <details><summary>Merge conflicts</summary> ``` CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp (2 hunks) CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp (9 hunks) CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp (5 hunks) CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp (1 hunk) CONFLICT (content): core/libs/prx/libSceAgcDriver/tests/Graphics.cpp (2 hunks) CONFLICT (content): docs/dev/debt/libSceAgcDriver.md (1 hunk) ``` </details> <details><summary>ctest at PR head (excerpt)</summary> ``` 525: layered depth target tests passed 16/27 Test #525: agc_driver_layered_depth_target ........... Passed 0.35 sec 319: Graphics validation tests passed 524: layered array color draw tests passed 100% tests passed out of 27 654 - agc_driver_stencil_ref_export (Skipped) ``` </details> <details><summary>Validation messages (same in both runs)</summary> ``` 364: Validation Error: [ VUID-vkBeginCommandBuffer-commandBuffer-00050 ] | MessageID = 0xb24f00f5 364: vkBeginCommandBuffer(): VkCommandBuffer ... was recorded and now in the executable state. You must call vkResetCommandBuffer() before calling vkBeginCommandBuffer() again. ``` 20 lines from `agc_driver_depth_storage` and 20 from `agc_driver_native_multisample_depth`, at both the PR head and the merge base. </details> ## Negative control At the PR head I restored `DepthSurface.cpp`, `Draw.cpp`, `State.cpp`, `Texture.cpp` and `Texture.hpp` from `ebe289bdc7`, the PR's last commit before its own change. I kept `State.hpp` (the new `DepthTarget::layers` field) and the tests, then rebuilt. Both tests fail: ``` agc_driver_graphics: AGC graphics: layered rendering with a depth target is unsupported agc_driver_layered_depth_target: AGC graphics: a layered draw after a draw into depth slice 2 alone: slice 1 texel (0, 0) is 0.250000, expected 0.750000 (the depth test of a ramp from 0 to 1 over 32 texels passes on the first 32) ``` After the run I restored the PR's files. ## Findings ### Blocking 1. **The branch conflicts with `main`.** This confirms the conflict list in the earlier comment from oneandonlydean: the same six files, 20 hunks. The conflicts touch the code this PR changes. A rebase has to reapply the per-layer logic to code that `main` has since rewritten: - In the depth plane fill on `main`, the direct image copy and the `UNDEFINED -> TRANSFER_DST_OPTIMAL` discard barriers hard-code array layer 0 ([DepthSurface.cpp#L735-L780 on main](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L735-L780)). That was correct for a one-layer image. On the shared array image this PR introduces, a fill of slice *k* would discard and overwrite layer 0, slice 0's contents. All four depth-image subresources there need `layer`: `depthRegion`, the destination of `copy`, and both `discard.subresourceRange`. The new test should also cover a direct-copy fill of a non-zero slice. - The surface constructor on `main` allocates through `AllocateImageMemory` ([L316](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L316)). The `array != nullptr` branch has to keep that path. - The depth `Texture` constructor on `main` gained a `VkImageUsageFlags usage` parameter before `layerCount`. This PR's `Sampled()` call passes `..., layer, owned, 1u`. Rebased as is, that `1u` would become `usage` rather than `layerCount`. - `Sampled()` on `main` now goes through the multisample sample shadow (around [L481](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L481)). The `layer`, `1u` arguments must be carried into that call. Because the resolved code will differ from what was tested, the GPU results here and in the description need rerunning after the rebase. ### Non-blocking 1. **The debt file keeps a contradicting entry.** The "HTILE address of a depth array slice" entry ([debt line 42 at the PR head](https://github.com/boykopovar/AnyPS5/blob/5589752147fe73b1487bce01b985b83e70f42b15/docs/dev/debt/libSceAgcDriver.md#L42), [line 76 on main](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/docs/dev/debt/libSceAgcDriver.md#L76)) says `decodeDepth` does not add the slice offset to `htileAddress`, so all slices share slice 0's HTILE. But `decodeDepth` already adds it ([State.cpp:310 at the PR head](https://github.com/boykopovar/AnyPS5/blob/5589752147fe73b1487bce01b985b83e70f42b15/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L310), since 8fec47a4b2). The new "Layered depth targets" entry (line 144) relies on that per-slice HTILE address. The stale entry predates this PR, but this PR now documents the opposite behaviour. Please remove or rewrite it while resolving the debt-file conflict. 2. **The description's dependency is out of date.** [#7254](https://github.com/boykopovar/AnyPS5/pull/7254) was merged on 2026-10-19 from a later head, `deb0ba305`. This branch still carries its four pre-merge commits. After rebasing, those commits should go, `Depends on` should read `none`, and the description should drop "the first four commits of this branch are #7254's". I found no correctness problem in the PR's own logic at its base. `layerTarget` steps Z, stencil and HTILE by one slice from the decoded first slice, which matches `decodeDepth`. The layered image's view is torn down before the surfaces that share its `OwnedImage`. The unimplemented cases (multisampled, stencil-only, mismatched slice counts) throw. ## Not verified - A build or tests of the merged tree, because it does not merge. - The PPSA01317 claim and the RTX 4090 report in the comments. I did not launch any title. - Windows/MinGW builds. - `agc_driver_stencil_ref_export`, which also skips on this device. ## To get this to a good state 1. Rebase onto current `main`, dropping the pre-merge #7254 commits. Then carry `layer` through `main`'s direct depth copy, discard barriers, `AllocateImageMemory` path and sample-shadow `Texture` construction. 2. Add a check to `agc_driver_layered_depth_target` that fills a non-zero slice through the direct depth copy and then reads slice 0 back unchanged. 3. Remove or rewrite the stale "HTILE address of a depth array slice" debt entry. 4. Rerun the layered, depth, stencil and graphics tests on the rebased branch, with the validation layer, on `main` and on the change. Update `Depends on` to `none`.
CnRJay commented 2026-11-01 19:52:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:52:37Z.

Review: COMMENTED


Points on 7256:

  1. Comments in code. Draw.cpp ("DecodeColorBuffer offsets slice s by s times this size; every slice the image stores...") and tests/execution/LayeredArrayColorDraw.cpp (a four-line header comment) add comments. The rule is no comments except #endif and namespace ends.

  2. Graphics test protocol. This is an AGC change, so the same focused tests need to be run on main and on the change with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, same machine and GPU, with a statement that no new VUID- lines appear. Please fill GPUs tested with that result.

  3. Negative control. Does the new layered-array test fail on main for case (a) (slices 1..3 of a four-slice array) and case (b) (slices 0..2 of a one-slice surface)? Please paste the failing main output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729932491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256#pullrequestreview-5729932491). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:52:37Z. **Review:** COMMENTED --- Points on 7256: 1. **Comments in code.** `Draw.cpp` ("DecodeColorBuffer offsets slice s by s times this size; every slice the image stores...") and `tests/execution/LayeredArrayColorDraw.cpp` (a four-line header comment) add comments. The rule is no comments except `#endif` and namespace ends. 2. **Graphics test protocol.** This is an AGC change, so the same focused tests need to be run on main and on the change with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, same machine and GPU, with a statement that no new `VUID-` lines appear. Please fill `GPUs tested` with that result. 3. **Negative control.** Does the new layered-array test fail on main for case (a) (slices 1..3 of a four-slice array) and case (b) (slices 0..2 of a one-slice surface)? Please paste the failing main output.
MarcZX10 commented 2026-11-16 20:27:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T20:27:11Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 6ceaa3963ca2c9ac5a2e362b6ea6b3f4e7dbc3ad using the prepared diff and repo_read.py at the pinned head. No commands or tests were run. The PR description reports GPU and related test runs; those were not performed as part of this review.

Results

Check Result Note
Diff and targeted code review passed Layered depth flow and relevant callers inspected
Tests in this review not run Author-reported runs only

Findings

Blocking

None found in the code inspected.

Non-blocking

None.

Not verified

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded from the review folder for size and was not read. All other changed files listed in the manifest were read, including the full LayeredDepthTarget.cpp diff. No tests were run, and the author-reported hardware behavior and test results were not independently confirmed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5927026530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7256#pullrequestreview-5927026530). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T20:27:11Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `6ceaa3963ca2c9ac5a2e362b6ea6b3f4e7dbc3ad` using the prepared diff and `repo_read.py` at the pinned head. No commands or tests were run. The PR description reports GPU and related test runs; those were not performed as part of this review. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted code review | passed | Layered depth flow and relevant callers inspected | | Tests in this review | not run | Author-reported runs only | ## Findings ### Blocking None found in the code inspected. ### Non-blocking None. ## Not verified `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` was excluded from the review folder for size and was not read. All other changed files listed in the manifest were read, including the full `LayeredDepthTarget.cpp` diff. No tests were run, and the author-reported hardware behavior and test results were not independently confirmed. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/7256:upstream-pr/7256'
git switch 'upstream-pr/7256'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/7256'
git switch 'upstream-pr/7256'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/7256'
git switch 'upstream-pr/7256'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/7256'
git switch 'main'
git merge --squash 'upstream-pr/7256'
git switch 'main'
git merge --ff-only 'upstream-pr/7256'
git switch 'main'
git merge 'upstream-pr/7256'
git push origin 'main'
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!7256
No description provided.