Skip to content

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

Merged
oneandonlydean merged 9 commits into
boykopovar:mainfrom
ntamas94:up/ps4-depth-sample-extent
Nov 3, 2026
Merged

oneandonlydean merged 9 commits into
boykopovar:mainfrom
ntamas94:up/ps4-depth-sample-extent

Conversation

@ntamas94

@ntamas94 ntamas94 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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#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 (7d9a2fc) 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 fix(libSceAgcDriver): sample a PS4 depth buffer through a T# smaller than its padded extent Get-fix/AnyPS5#9 with my bring-up branch (Gang Beasts (CUSA04865) #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 (7d9a2fc) 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 7d9a2fc (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 (fix(libSceAgcDriver): sample a PS4 depth buffer through a T# smaller than its padded extent #9672 (comment)) on the previous head 43497e2 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 7d9a2fc merged in; feat(libSceAgcDriver): draw PS4 (GCN) command buffers #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 (feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431 is merged)
  • Fixes: none
  • Unblocks: CUSA04865 Gang Beasts (CUSA04865) #7941
  • GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (10.0.26200)
  • AI-assisted: yes

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6146 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6185 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 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 6743 docs/dev/debt/libSceAgcDriver.md
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6926 docs/dev/debt/libSceAgcDriver.md
PR 6973 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7085 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7504 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7668 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8707 docs/dev/debt/libSceAgcDriver.md
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9318 docs/dev/debt/libSceAgcDriver.md
PR 9335 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9489 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9700 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9742 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9892 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 9950 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10049 docs/dev/debt/libSceAgcDriver.md
PR 10064 docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 10256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10351 docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10469 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10472 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 10779 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10882 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 11104 docs/dev/debt/libSceAgcDriver.md
PR 11346 docs/dev/debt/libSceAgcDriver.md
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11557 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11587 docs/dev/debt/libSceAgcDriver.md
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11995 docs/dev/debt/libSceAgcDriver.md
PR 11998 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12120 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12452 docs/dev/debt/libSceAgcDriver.md
PR 12565 docs/dev/debt/libSceAgcDriver.md
PR 12567 docs/dev/debt/libSceAgcDriver.md
PR 12568 docs/dev/debt/libSceAgcDriver.md
PR 12617 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 12764 docs/dev/debt/libSceAgcDriver.md
PR 12792 docs/dev/debt/libSceAgcDriver.md
PR 12840 docs/dev/debt/libSceAgcDriver.md
PR 12855 docs/dev/debt/libSceAgcDriver.md
PR 12904 docs/dev/debt/libSceAgcDriver.md
PR 13021 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13023 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13146 docs/dev/debt/libSceAgcDriver.md
PR 13147 docs/dev/debt/libSceAgcDriver.md
PR 13151 docs/dev/debt/libSceAgcDriver.md
PR 13248 docs/dev/debt/libSceAgcDriver.md
PR 13474 docs/dev/debt/libSceAgcDriver.md
PR 13599 docs/dev/debt/libSceAgcDriver.md
PR 13707 docs/dev/debt/libSceAgcDriver.md
PR 13793 docs/dev/debt/libSceAgcDriver.md
PR 13809 docs/dev/debt/libSceAgcDriver.md
PR 13858 docs/dev/debt/libSceAgcDriver.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13963 docs/dev/debt/libSceAgcDriver.md
PR 13991 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13994 docs/dev/debt/libSceAgcDriver.md
PR 14005 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14018 docs/dev/debt/libSceAgcDriver.md
PR 14084 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 14085 docs/dev/debt/libSceAgcDriver.md
PR 14212 docs/dev/debt/libSceAgcDriver.md
PR 14220 docs/dev/debt/libSceAgcDriver.md
PR 14243 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14248 docs/dev/debt/libSceAgcDriver.md
PR 14265 docs/dev/debt/libSceAgcDriver.md
PR 14296 docs/dev/debt/libSceAgcDriver.md
PR 14302 docs/dev/debt/libSceAgcDriver.md
PR 14311 docs/dev/debt/libSceAgcDriver.md
PR 14344 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14475 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 14561 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14621 docs/dev/debt/libSceAgcDriver.md
PR 14628 docs/dev/debt/libSceAgcDriver.md
PR 14815 docs/dev/debt/libSceAgcDriver.md
PR 14909 docs/dev/debt/libSceAgcDriver.md
PR 14940 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 14943 docs/dev/debt/libSceAgcDriver.md
PR 14944 docs/dev/debt/libSceAgcDriver.md
PR 14950 docs/dev/debt/libSceAgcDriver.md
PR 14963 docs/dev/debt/libSceAgcDriver.md
PR 14964 docs/dev/debt/libSceAgcDriver.md
PR 14969 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 14976 docs/dev/debt/libSceAgcDriver.md
PR 14982 docs/dev/debt/libSceAgcDriver.md
PR 14993 docs/dev/debt/libSceAgcDriver.md
PR 15015 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 15058 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 15059 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 15067 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp

@fogydes

fogydes commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

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 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 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

Copy link
Copy Markdown
Contributor Author

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 7e2ba73) 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

…than its padded extent

On the PS4 a depth target's extent comes from DB_DEPTH_SIZE, which holds
the surface padded to whole macro tiles: a 1920x1080 Depth2D64 target is
2048x1152. Titles (Unity, as in Gang Beasts) then sample the depth plane
through a T# of the real size at the same address. The depth lookup only
accepted a T# exactly as large as the target, so it fell back to guest
memory, which never holds the native depth, and depth-of-field and
lighting passes read garbage.

A PS4 depth target now records that it is one (DepthTarget::gcn). A 2D
level-0 view of its depth plane that is no larger than the padded extent
is served by the existing depth plane copy, sized and keyed by the view:
it copies the view-sized top-left corner of the native depth image, 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. The crop is taken only when the T#'s GCN
pitch is the DB pitch and the device stores the plane in the guest's
depth format; otherwise the view reads guest memory as before.

The stencil plane through a smaller view still reads guest memory; the
debt entry says so. agc_driver_gcn_padded_depth_sampling draws D32 and D16
depth into 64x64 PS4 targets and reads it through 48x40 views, edges and
clamped coordinates included; it read 0.0 from guest memory before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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 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 7e2ba73 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
ntamas94 force-pushed the up/ps4-depth-sample-extent branch from 8cfd796 to 244e1da Compare October 22, 2026 13:21
@ntamas94

Copy link
Copy Markdown
Contributor Author

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 7e2ba73) 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

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
@ntamas94

Copy link
Copy Markdown
Contributor Author

Gang Beasts (CUSA04865) on the current stack: main 7e2ba73 + #9430, #9431, #9432 (Get-fix's rebased heads) + #9671-#9676, relinked with --windows --registry --module-dir Media/Modules --module-dir Media/Plugins and run with APS5_GNM_SUBMIT_WAIT_IDLE=1 on the same machine as the validation runs (NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 10.0.26200). Furthest point: title screen, Local, costume select, match setup, a stage in play (sharedassets13); 330 s, stopped by the run's timeout, no crash, about 42 FPS in the stage ([present] 418 presents over 10 s), 13,771 presents from the resident image, not implemented and AGC graphics: throws: 0.

The six pull requests alone do not carry the title over main; the bare stack stopped, in this order, on: the PS4 T# base address read as 40 bits (storage texture has no committed guest pages; fixed by Get-fix#1's 38-bit base address commit a2bd6f6, not in #9431), the rect-list point/line polygon-mode throw that e61d31d added (register 0x205 = 0x12c; run with a local stand-in that draws it filled, PS4 behaviour not measured), the GCN image dimension taken from the T# and MTBUF (Get-fix#1 f9b38d1 and 6350d27), and the white lighting without #6948. Those were added for the run and will be listed on the bring-up discussion #7941 with the log; the run log (11 MB) is kept and can be attached there.

For this PR: the stage lighting and shadows are correct in the run (the depth crop's visible effect; the build has no per-view diagnostic, so there is no log line for the crop itself).

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@github-actions github-actions Bot added docs prx agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 22, 2026
@ntamas94

Copy link
Copy Markdown
Contributor Author

The conflict is in the base: #9431 (and #9432 over it) conflicts with current main in core/libs/prx/libSceAgcDriver/Graphics/include/GuestTextureResource.hpp since 02dde0f (feat(agc): expose expanded FMASK for tracked native owners); this branch adds no conflict of its own (its merge with main fails on that one file only). I will rebase onto #9431's next head as soon as Get-fix has rebased it, and rerun the focused tests, the paired validation and the checks on that merge commit.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@ntamas94

Copy link
Copy Markdown
Contributor Author

Landing-order note: @savvaniss's #9895 (PS4 depth planes kept coherent with buffer reads) adds std::optional<TextureTileMode> gcnTileMode to DepthTarget on the same line where this PR adds bool gcn, and both extend the PS4 depth text in docs/dev/debt/libSceAgcDriver.md. The two fields carry the same fact (a PS4 depth target), so whichever lands second can drop its own: if #9895 lands first, I will rebase this PR to test gcnTileMode.has_value() instead of adding gcn; if this one lands first, #9895 can use either. No other overlap with #9891, #9892 or #9895.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@frankea

frankea commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@ntamas94 a merge-order note for this stack and #9700 (EQAA color targets), which the overlap check pairs. Apart from the GuestTextureResource.hpp conflict this branch already has with main, this PR (with #9431 under it) and #9700's head d902416 both extend DrawKeyRegisters in State.hpp: here two more ranges and 52 entries, in #9700 CB_COLOR0..7_FMASK_BASE_EXT (0x3a0, 8 words) and 51 entries. Neither needs the other, so I've recorded it in #9700 as: whichever lands second keeps every range and counts them all. Tell me if you'd rather fix an order.

AI-assisted: yes (Claude Code)

@ntamas94

Copy link
Copy Markdown
Contributor Author

Thanks, @frankea, fine with me. One detail: the DrawKeyRegisters extension (the two extra ranges and 52 entries) comes from #9431 under this PR; this PR's own State.hpp change is only the bool gcn field in DepthTarget. So the order is between #9431 and #9700, and your rule (whichever lands second keeps every range and counts them all) covers it; when I rebase this PR onto #9431's next head, I'll take whatever that head has.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@XairRrR XairRrR 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.

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.

@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.

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.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 43497e2 merged onto main ba5b533 · tested 2026-10-29 13:25 UTC · 23 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,211 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 39 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,254 of 2,891 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (856 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 3 of the last 5 main runs
Failing on main too (3, not counted against this PR)
agc_compute_pipeline_inspection
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 404 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (404 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alpha_to_coverage, agc_driver_array_layer_target_cpu, agc_driver_bc_block_copy, and 396 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin 43497e2a964d861222522467c363e5e7b3051cf1 ba5b5330b37724bca4b99f30faab504653635a04
git checkout ba5b5330b37724bca4b99f30faab504653635a04 && git merge --no-ff 43497e2a964d861222522467c363e5e7b3051cf1
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@ntamas94

Copy link
Copy Markdown
Contributor Author

@MarcZX10, done: current main (bb04a4f) is merged in (bbff2fb). The merge was clean; the debt entry this PR changes and main's new text merged without a conflict.

On that exact head:

  • agc_driver_gcn_padded_depth_sampling and the 21 other depth tests listed in the description pass, 22 tests, three runs each.
  • Paired validation-layer run against main bb04a4f, built on the same machine (RTX 2080, driver 617.14) with the same env:
    • main: 100% of 24 tests passed.
    • This branch: 100% of 22 tests passed.
    • The layer is loaded on both sides (60 loader lines each), no was not found line, 0 VUID- ids on either side, 0 new.
  • check_conventions --base main with the updated description: no findings.

TechLevelZero's NVIDIA CI on the previous head (43497e2 merged onto ba5b533) is also in the report: 0 new failures and no new validation IDs against main in 856 GPU tests. The Gang Beasts run stays labelled as the earlier Get-fix result; it has not been rerun on this head.

AI-assisted: yes (Claude Code)

…epth-sample-extent

# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@ntamas94

Copy link
Copy Markdown
Contributor Author

main moved again (951f374), and this time the merge had one conflict (c599331): DepthSurfaceTexture's planes condition. #12207 changed its cube term so that a cube array of any multiple of six layers qualifies; this PR drops the exact-extent and baseLevel terms there. The merged condition keeps both: main's cube-array rule, and this PR's view-sized extent.

On that exact head:

  • The 22 depth tests in the description pass, three runs each. So does main's new stencil_plane_memory, which covers the stencil-plane changes that came in with this merge.
  • Paired validation-layer run against main 951f374, rebuilt on the same machine with the same env: 24 and 22 tests, all passed. The layer is loaded on both sides, there is no was not found line, and there are 0 VUID- ids on either side.
  • check_conventions --base main: no findings.
  • The description now names this head and this main.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 2026

@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.

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.

…epth-sample-extent

# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@ntamas94

Copy link
Copy Markdown
Contributor Author

main moved again (02e8957), and f8474c4 merges it. The conflict is on the same planes line in DepthSurfaceTexture. a079dec changed the stale check right below it to OverwrittenInMemory() || OverwrittenOnGpu(), so that pending storage writes over a depth plane count as a later writer. The merged lines keep that check, the cube-array rule, and this PR's view-sized extent.

On that exact head:

  • The 22 depth tests and stencil_plane_memory pass, three runs each. depth_surface_from_storage, which a079dec extended, is among them.
  • Paired validation-layer run against main 02e8957, rebuilt on the same machine with the same env: 25 and 23 tests, all passed. The layer is loaded on both sides, there is no was not found line, and there are 0 VUID- ids on either side.
  • check_conventions --base main: no findings.
  • The description names this head and this main.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head f8474c4 merged onto main f6fddd6 · tested 2026-10-30 03:35 UTC · 28 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,263 passed · 3 failed (0 new, 2 also fail on main, 1 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,307 of 2,950 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (863 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 46.6 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 5 of the last 7 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 391 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (391 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_array_layer_target_cpu, agc_driver_bitfield_mask, and 383 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin f8474c4752b045086796028a92c94566ea7f4dbd f6fddd60d826831f70f7c62e25423610ee742bcc
git checkout f6fddd60d826831f70f7c62e25423610ee742bcc && git merge --no-ff f8474c4752b045086796028a92c94566ea7f4dbd
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@MarcZX10

Copy link
Copy Markdown
Contributor

Re-checked — current-main validation still needed

The NVIDIA run adds useful exact-head results, but it uses an older integration: the report merges head f8474c4752b045086796028a92c94566ea7f4dbd onto f6fddd60d826831f70f7c62e25423610ee742bcc, while current main is 5ecef095b61e7a406b279c97896f3a8a6fbd6353.

Since the PR's reported baseline 02e89573e5b81146f173c5ef4f66950828686ae7, current main changed Graphics/include/State.hpp and Graphics/src/State.cpp, both touched by this PR. The current-main merge preview is clean, but that does not update the reported validation comparison. Please rerun the focused comparison on current main and this head, or explain why these intervening changes do not affect the test path. The existing changes-requested review remains; I did not run GPU tests locally.

Exact-head NVIDIA report.

…epth-sample-extent

# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
…gth limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ntamas94

Copy link
Copy Markdown
Contributor Author

main moved again (7d9a2fc), and 08437f8 merges it. The conflict this time is in the "PS4 render targets and display buffers" debt entry: cd67746 appended a sentence on shadPS4's display-buffer width, in the place where this PR appends its PS4 depth-target sentence. The entry now keeps both. With main's text it went over 1000 characters, so f8bc6eb shortens this PR's sentence and leaves main's text unchanged.

On head f8bc6eb:

  • The 22 depth tests and stencil_plane_memory pass, three runs each.
  • Paired validation-layer run against main 7d9a2fc, rebuilt on the same machine with the same env: 25 and 23 tests, all passed. The layer is loaded on both sides (62 loader lines each), there is no was not found line, and there are 0 VUID- ids on either side.
  • check_conventions --base main: no findings.
  • The description names this main.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@TechLevelZero

TechLevelZero commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head f8bc6eb merged onto main e6f5730 · tested 2026-11-01 12:55 UTC · 22 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,433 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,482 of 3,148 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (932 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 74.1 s, ⚠️ agc_driver_graphics_maps_fallback 30.7 s, ⚠️ agc_driver_graphics 30.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_padded_depth_sampling
Validation IDs already present on main (5 IDs in 481 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (481 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 473 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin f8bc6ebb92e3f57225fae3fd9b60fdb7f906cbf4 e6f57307fa7f47165d7fc1bee945abdb2f6816e7
git checkout e6f57307fa7f47165d7fc1bee945abdb2f6816e7 && git merge --no-ff f8bc6ebb92e3f57225fae3fd9b60fdb7f906cbf4
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@RNK123

RNK123 commented Nov 2, 2026

Copy link
Copy Markdown

Independent AMD/Linux RADV result: the cropped D32 and D16 depth views pass all existing sampling/load, edge/clamp and redraw-refresh assertions, three times, with no new Vulkan validation findings.

Head f8bc6ebb92e3f57225fae3fd9b60fdb7f906cbf4 merged cleanly onto main 926f7dd492b0b432d9287f4d6faaaf1c9d3c86c5.

  • Three existing controls (agc_driver_depth_plane_sampling, agc_driver_depth_plane_guest_layers, agc_driver_depth_surface_last_writer) pass 3/3 each on main and on the merge.
  • New agc_driver_gcn_padded_depth_sampling passes 3/3. Both D32/R32F and D16/R16 cases complete, before and after redraw, rather than skipping either format. The fixture checks 256 sampled/loaded values per invocation; D32 is bit-exact and D16 uses its existing 2/65535 tolerance.
  • Feature-disabled counter-test: changing only the merged const bool cropped = ... predicate to false fails 3/3 at the intended first D32 sample: read 0.00000000, expected 0.25000000. Restoring that expression passes 3/3 again. Fixture and state metadata are unchanged throughout (fixture SHA-256 b779cb19807271305f666653f884ec66f467c53dc02e322bfd3b13b19f58b11a). This is not a pristine-main execution of the new fixture: main lacks its DepthTarget::gcn field.
  • Pristine main was restored/rebuilt; all three original controls pass again. All 30 protocol invocations confirm the RX 9060 XT and actual Khronos layer insertion, with zero skips, Khronos errors/warnings, VUIDs or sync hazards. The same unrelated liblsfg loader diagnostic and RADV testing warning appear on both trees.

Environment: CachyOS, kernel 7.3.1-1-cachyos; AMD Radeon RX 9060 XT (1002:7590, RADV GFX1200), Mesa 26.2.5-arch3.1, Vulkan 1.4.354; Khronos validation 1.4.363; GCC 16.2.1, Release, BUILD_TESTING=ON, SPIRV-Tools OFF.

Commands and scope

Build the three controls' corresponding _tests targets on main, and add agc_driver_gcn_padded_depth_sampling_tests on the merge:

export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
export VK_LAYER_PATH=/path/to/validation-layer/explicit_layer.d
ctest --test-dir build-main -R '^(agc_driver_depth_plane_sampling|agc_driver_depth_plane_guest_layers|agc_driver_depth_surface_last_writer|agc_driver_gcn_padded_depth_sampling)$' -V --parallel 1 --repeat until-fail:3 --timeout 30 --no-tests=error

For the counter-test, disable just cropped in Graphics/src/DepthSurface.cpp, rebuild the new target and run its entry three separate times; then restore the expression, rebuild and repeat. No test-source edit is involved.

Limits: the existing fixture uses an RDNA-style descriptor over a target marked GCN; this does not independently test GCN descriptor decoding. No game, console, other OS, performance or full-suite run.

AI-assisted independent hardware test run (GPT-6.1-sol).

@XairRrR XairRrR 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.

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 7d9a2fc 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.

@oneandonlydean oneandonlydean self-assigned this Nov 3, 2026
@oneandonlydean
oneandonlydean merged commit 6457b9a into boykopovar:main Nov 3, 2026
12 checks passed
oneandonlydean added a commit to savvaniss/AnyPS5 that referenced this pull request Nov 3, 2026
State.hpp: DepthTarget keeps both fields, the PR's gcnTileMode (DB_Z_INFO tiling of a PS4 depth plane) and main's gcn (PS4 guest flag, boykopovar#9672); they are separate facts.
Debt doc: the PS4 render target line keeps both added clauses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants