Skip to content

fix(agc): sample a cube array over depth surfaces through their depth planes - #12207

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
XairRrR:fix/agc-depth-cube-array-planes
Oct 29, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
XairRrR:fix/agc-depth-cube-array-planes

Conversation

@XairRrR

@XairRrR XairRrR commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

A cube T# whose last array slice is 6n - 1 is a cube array of n cubes. When it lies over a depth surface, the depth plane path (DepthSurfaceTexture) accepted one cube only (last array slice 0 or 5) and threw sampling the depth planes of depth surface ... is not implemented for the rest. It now gathers all 6n slices into the 2D array copy, the layout the colour texture path already uses for cube arrays. The refusal message also names the last array slice, whether the view reads depth bits, and the copy format, since the slice count it printed for a cube was always 6.

PPSA05684 (Uncharted: Legacy of Thieves Collection) samples a two-cube D32 shadow array this way (last array slice 11) right after Uncharted 4's orphanage chapter loads.

Tested

Arch Linux 7.2.11-zen, GCC 16.2.1, Ninja, Release, on main 3ca715e:

  • agc_driver_depth_plane_guest_layers gains RunCubeArrayGather: two cubes of depth surfaces over 12 slices, sampled through one cube array T#, each slice read back. With DepthSurface.cpp from main it fails with the title's error (... dimension 3, 6 slices, levels 0-0, base slice 0 is not implemented).
  • Full ctest -j8 (this branch together with my five other branches of today, on the same main): 2619 of 2620 pass; agc_driver_mesh_barycentric_emulation fails the same way on main on this GPU (the pixel shader did not emulate barycentrics).
  • tools/check_conventions.py --base origin/main passes, with one debt-length warning on the depth plane copies entry this edits (already 2005 characters on main).
  • PPSA05684: the orphanage chapter loads and plays past the point where it threw.

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: none (fix(agc): sample cube descriptors with fewer than six slices as six faces #11507 changes cube descriptors with fewer than six slices in the texture decode; it does not touch this path)
  • Fixes: none
  • Unblocks: PPSA05684 Uncharted: Legacy of Thieves Collection (PPSA05684) on Linux / NVIDIA #4001 (throw when the orphanage chapter loads)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti SUPER, driver 615.78.08, Arch Linux 7.2.11-zen
  • AI-assisted: yes

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L2652
PR 10854 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L2652-2653
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L2651-2652
PR 12120 docs/dev/debt/libSceAgcDriver.md L114

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6185 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7048 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9508 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9748 docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 10026 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 10472 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10920 core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneGuestLayers.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11825 docs/dev/debt/libSceAgcDriver.md
PR 12904 docs/dev/debt/libSceAgcDriver.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inclusive LAST_ARRAY check accepts only cube face counts divisible by six, and the new fixture covers gathering 12 slices plus rejecting an 8-slice cube. I found no separate defect by static inspection. This branch is 60 commits behind current main; please rebase and rerun agc_driver_depth_plane_guest_layers on current main and the rebased change. As an AGC change, also provide the repository-required paired validation-layer run and confirm the rebased change adds no VUID- errors.

@maskym

maskym commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head a63aa903b9, merged into main 3b979d42a9 (the PR's GPUs tested line names no NVIDIA run on Windows).

This PR's own tests: agc_driver_depth_plane_guest_layers (0.44 s), all passed.

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver 621.01), Khronos Validation Layers nightly 1.4.366 (b2b44c0d37) through VK_ADD_LAYER_PATH, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

Same focused run on main 3b979d42a9 and on this tree, same machine and GPU: 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 -R '^(agc|guest_video_out|video_out)' --parallel 4 -V.

The tree also carried the open PRs #12298, #12272, #12262, #12256, #12250, #12234, #12228, #12211, #12210, #12209, #12208, all merged cleanly, so the run is a joint one. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@adriadam10 adriadam10 self-assigned this Oct 28, 2026
… planes

A cube T# whose last array slice is 6n - 1 is a cube array of n cubes.
The depth plane path accepted one cube only (last array 0 or 5) and
threw for the rest; it now gathers all 6n slices into the 2D array
view, as the texture path already lays cubes out. The refusal message
also names the last array slice and the copy format.

Uncharted 4's orphanage samples a two-cube D32 shadow array this way.

AI-assisted: yes
@XairRrR
XairRrR force-pushed the fix/agc-depth-cube-array-planes branch from a63aa90 to a226b66 Compare October 28, 2026 19:01
@XairRrR

XairRrR commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main e4da19a (head a226b66), no conflicts. agc_driver_depth_plane_guest_layers passes on the rebased head.

Rebased on main e4da19a. Arch Linux 7.2.11-zen, GCC 16.2.1, Release, RTX 4070 Ti SUPER (NVIDIA 615.78.08), Khronos validation layers 1.4.363. VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest -R '^(agc|guest_video_out|video_out|guest_process_time)' on main plus #12206, #12207, #12208, #12210 and #12238 rebased: 1145/1145 pass. The loader inserted the layer 1000 times, no log line says it was not found, and the only VUID is VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (18 times), the one maskym's run reports on main (#6782). I did not run main alone on Linux; maskym's paired Windows run above covers that side.

AI-assisted: yes

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the 6n - 1 last-array condition and layers = max(last + 1, 6) (single cubes still take 6), the new RunCubeArrayGather (12 slices gathered, 12 surface copies + 1 plane fill, 8 slices still refused; it fails on main at the != 5 check), the debt entry, and the paired validation runs (yours on Linux, @maskym's on Windows/NVIDIA: no new VUID-). @MarcZX10's requested rebase and paired run are done on this head; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants