Repository navigation
fix(libSceAgcDriver): sample a PS4 depth buffer through a T# smaller than its padded extent - #9672
Conversation
|
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.
|
|
Reviewed; the crop itself is right. The Two things worth recording before merge (either in the debt entry or the body):
|
MarcZX10
left a comment
There was a problem hiding this comment.
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.
e79760c to
8cfd796
Compare
|
Thanks. The branch conflicts with 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
left a comment
There was a problem hiding this comment.
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.
8cfd796 to
244e1da
Compare
|
Rebased onto #9431's new head ( AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
Gang Beasts (CUSA04865) on the current stack: The six pull requests alone do not carry the title over 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 |
|
The conflict is in the base: #9431 (and #9432 over it) conflicts with current AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
Landing-order note: @savvaniss's #9895 (PS4 depth planes kept coherent with buffer reads) adds AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
|
@ntamas94 a merge-order note for this stack and #9700 (EQAA color targets), which the overlap check pairs. Apart from the AI-assisted: yes (Claude Code) |
|
Thanks, @frankea, fine with me. One detail: the AI-assisted: yes (Claude Code) 🤖 Generated with Claude Code |
XairRrR
left a comment
There was a problem hiding this comment.
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.mdauto-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-failureResults
| 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
-
The
gcnPitch == 0arm 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::gcnis set fromShaderRecompiler::GcnGuestShaders()(State.cpp:453-454).- The T# decoder reads the same global flag and, when it is set, always fills
gcnPitchand requiresgcnPitch >= width, so the pitch is never 0 (GuestTextureResource.cpp:312-315). - So in a running PS4 title,
base.gcn && resource.gcnPitch == 0cannot happen, and theresource.gcnPitch == 0 ||term incropped(DepthSurface.cpp:2509) exists only for the test. - The test reaches it by setting
state.depth->gcn = trueby 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 betweenDB_DEPTH_SIZEand the T# pitch.
The execution harness can already switch to GCN guest mode:
GcnBufferFormatLookup.cppcallsShaderRecompiler::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_MIBbudget when a title keeps both a cropped and a full-size copy of one target.agc_driver_depth_plane_sampling_evictingpasses, but it does not include a cropped view.
MarcZX10
left a comment
There was a problem hiding this comment.
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.
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (4 IDs in 404 tests)Skipped (39)ReproduceAutomated 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. |
…epth-sample-extent
|
@MarcZX10, done: current On that exact head:
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 AI-assisted: yes (Claude Code) |
…epth-sample-extent # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
|
On that exact head:
AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
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/AnyPS5Results
| 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 with951f374c87, while livemainis nowc40cef843681418b4d66df2939a92ba8ba6ba5d9. The merge preview is clean, butCONTRIBUTING.mdrequires one branch based on currentmain. Please update the branch and refresh the exact-head test report before approval.
Non-blocking
- The latest report adds useful coverage for
stencil_plane_memoryand describes theDepthSurfaceTexture::planesconflict resolution. I did not independently run those tests or verify GPU behavior.
Sources
- Contribution rule at
c40cef843681418b4d66df2939a92ba8ba6ba5d9 - PR changes at
c599331a9b9e575a1458c75def9b03acd9d0cfb6
Not verified
I did not run the focused tests, a local build, Vulkan validation, or a console/title run. The author’s test results are reported, not independently confirmed.
To get this to a good state
Update onto live main, rerun the same focused depth and validation-layer checks on the resulting exact head and base, and refresh the report. I will rerun the merge preview, whitespace check, and relevant tests against that new head.
…epth-sample-extent # Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
|
On that exact head:
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validation IDs already present on main (4 IDs in 391 tests)Skipped (41)ReproduceAutomated 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. |
Re-checked — current-main validation still neededThe NVIDIA run adds useful exact-head results, but it uses an older integration: the report merges head Since the PR's reported baseline |
…epth-sample-extent # Conflicts: # docs/dev/debt/libSceAgcDriver.md
…gth limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
On head f8bc6eb:
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 481 tests)Skipped (45)ReproduceAutomated 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. |
|
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
Environment: CachyOS, kernel Commands and scopeBuild the three controls' corresponding 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=errorFor the counter-test, disable just 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
left a comment
There was a problem hiding this comment.
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
244e1da99bis unchanged. The PR's code diff againstmainis still the same:- the
DepthTarget::gcnfield and the line that sets it; - the
exact/croppedgate and the view-sized plane copy key and extent inDepthSurfaceTexture; - the new execution test.
- the
- Merge resolutions: the merges of
maintouch theplanesline and the stale check right below it. The merged lines keepmain's cube-array rule and theOverwrittenInMemory() || OverwrittenOnGpu()check, and drop only the exact-extent andbaseLevelterms. ThebaseLevelcheck now happens earlier in the function. - Debt entry:
f8bc6ebb92shortens 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
main7d9a2fc for the author's runs. It adds TechLevelZero's NVIDIA CI on43497e2a96. RNK123 also posted an AMD/RADV run onf8bc6ebb92(author-reported by them, not checked by me).
What I ran
- PR head
d8d638d5af0d0669cf6b1a2bc067acaa8c9e3343 main4f41f4c375f5abb487dbd184fbc150f31994d762- 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 == 0arm of the crop gate runs only in the test, and thegcnPitch == base.extent.widtharm 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.
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.
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.DepthSurfaceTextureonly 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: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: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) tomain, as Get-fix asked there. It was stacked on #9431, which is merged; the branch now has currentmainmerged in.mainmeanwhile 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 theplanescondition.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 currentmain(7d9a2fc) merged in; #9431 is merged, so the branch's diff againstmainis 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; withDepthSurface.cppreverted to the base it reads guest memory and fails (read 0.00000000, expected 0.25000000).agc_driver_graphicsand 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'sstencil_plane_memorypasses too:native_multisample_depthtakes 1 to 2 s alone on both this branch andmain, but ran past its 30 s limit while builds loaded the machine.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.main7d9a2fc (100% tests passed out of 25, the depth, display-buffer and graphics tests of this stack) and this branch with thatmainmerged in (100% tests passed out of 23, the tests above andstencil_plane_memory) withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andVK_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'sadding layers "VK_LAYER_KHRONOS_validation"line (62 and 62 times) and neither reportswas not found but was requested by env var VK_INSTANCE_LAYERS;VUID-ids onmain: 0, on this branch: 0, new on this branch: 0.mainba5b533: build passed, 2,211 tests passed, 0 new failures (3 also fail onmain, 1 unstable there), no new validation IDs againstmainin 856 GPU tests, on an NVIDIA RTX 2000 Ada under Ubuntu.Checklist
main; no other open PR implements the same functions (currentmain7d9a2fc merged in; feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431 is merged; searched open boykopovar/AnyPS5 PRs for padded depth, depth extent andDB_DEPTH_SIZEon 2026-10-22)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)