feat(agc): sample depth plane arrays from a later base slice #1186
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1186"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T16:45:33Z.
What
A T# that reads a depth surface's planes as a 2D array whose BASE_ARRAY is past slice 0 views the plane copy from that slice, instead of being refused (the copy holds slices 0 to LAST_ARRAY). A 2D binding of such a plane array reads its base slice through a one-slice view.
Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB, MinGW-w64 GCC 15.2.0.
gta-v/testingbranch (Performance mode, the prologue).main0214069e3(2026-10-13):agc_driver_depth_plane_samplingpasses with its base-slice cases (a D32 2D array from base slice 1 through an array and a 2D image, and a D16 plane read asR16_UINTfrom base slice 1), which replacemain's refusal case. The wholeagc_*suite passes on Windows (483 tests).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T21:43:33Z.
A case for this from Demon's Souls (PPSA01341 v1.07) on Linux (Nobara 44, RTX 5070 Ti, 595.91.07). Since #1086 and #1346 merged, the title's shadow pass renders, and after NEW GAME a compute shader reads the 1024x1024 D32 shadow map as a one-slice 2D array. On
main4b005b22(plus #861, which this title needs to start on Linux) that aborts:Dimension 2 is
k2DArray, base slice 0, same extent and format as the plane. With this PR merged on the same base (clean merge), the abort is gone. The title goes from the main menu through NEW GAME to character creation and exits 0 when the window is closed. One run per arm.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:36Z.
@fisherjoey thanks, a shadow-map read from a later base slice after NEW GAME is exactly the case this is for.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:40:55Z.
Review: DISMISSED
Thanks, the diagnosis in the thread (a one-slice D32 shadow map read as a 2D array from a later base slice) matches the change. This PR is stacked on #419/#425/#454, so I reviewed only the last commit (
fd0ddc6a6). One thing blocks it:DepthSurface.cpp/Texture.cppbut adds nothing underlibSceAgcDriver/tests. Please add a case that samples a depth plane array withBASE_ARRAY > 0(array view and the 2D one-slice view), pinning the slice values read, and that fails without the change. Also pin the cases that must keep throwing (BASE_ARRAY > DEPTH, cube withBASE_ARRAY != 0, non-array withBASE_ARRAY != 0).docs/dev/TechnicalDebt.mdsaying the base-slice semantics of depth plane arrays come from the title's usage and were not measured on hardware. Do not put it at the end of the section.It also conflicts with
main(DepthFastClearHarness.hpp,DepthFastClearSubmit.cpp,TechnicalDebt.md); that should resolve once the bases land and this is rebased.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T12:14:59Z.
@adriadam10 thanks. I'll add the test (array view and one-slice 2D view of a depth plane array with
BASE_ARRAY > 0, pinning the slices read and failing without the change, plus the three cases that keep throwing) and the TechnicalDebt line under "Unknown function info", then rebase once #419 and #425 are onmain.Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T15:28:47Z.
@adriadam10 the test and the TechnicalDebt line are in (
fd140d1ab). The branch is now stacked on the rebased #425 (6d59983d3), so it no longer conflicts withmain. The last two commits are this PR.depthPlaneArrayBaseSliceTestsintests/Recorder.cpp, registered as theagc_depth_plane_array_base_slicectest. It uses a three-slice 128x128 D32 surface: slice 0 is a live depth surface, and slices 1 and 2 hold 0.5 and 0.75 in guest memory. A 2D-array T# withBASE_ARRAY1 and then 2 reads each slice's value at every array layer, and its one-slice 2D view reads the base slice.BASE_ARRAYpastLAST_ARRAY, a cube withBASE_ARRAY1, and a 2D T# withBASE_ARRAY1.Once #425 merges, I'll rebase this so only these two commits remain.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T08:05:07Z.
#419 and #425 are on main now, so this conflicts through the carried commits. Please rebase down to the last two (
d02585cba,fd140d1ab).Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-13T13:41:03Z.
Resident Evil Village (PPSA01556, 01.210.000) stops on this while loading its first scene, on a local branch past its earlier stops (on
mainit stops at its first frame, #4949):A compute pass reads slice 1 of a two-slice 1024x1024 D32 array as an R32F 2D-array texture with BASE_ARRAY 1 and LAST_ARRAY 1. d02585cba gets the title past it. I applied it by hand to the current
DepthPlaneCopy, which has changed since.On a rebase, note that
main'sDepthPlaneSamplingtest now has aRefusalCasethat asserts this refusal. I replaced it with a base-slice case: a view from base slice 1 reads slices 1 and 2, and a 2D image reads slice 1. The adapted change is below, in case it saves you time. Setup: Windows 11, WinLibs GCC 15.2.0 r7, Release, RTX 3070 Laptop.d02585cba adapted to current main
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-13T14:35:48Z.
Data point from another title that needs this. Diablo II: Resurrected (PPSA03912, 01.039.000), Linux, RTX 3080 Ti (NVIDIA 615.71.09), main
0f2683cb7, aborts at the main menu with:It is a D16 surface read through an R16_UINT 2D array T# with BASE_ARRAY=1 and LAST_ARRAY=1, so it takes the integer-view path of the plane copy with a base slice above 0. If #1186 covers that path too, it would unblock this title.
I wrote the same change independently before finding this PR (a view over the copy of slices 0..LAST starting at BASE_ARRAY) and it gets the title past this point; the tests I wrote for it (BASE_ARRAY 1 and 2 on a 3-slice D32 array, read through
image_loadof the view's slices, failing without the change) are on https://github.com/mrfelek/AnyPS5/tree/pr/depth-plane-base-slice if they help with the review request for a test. Written with AI assistance (Claude Code).Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-13T16:10:48Z.
@oneandonlydean rebased down to the change and its test on current
main(0214069e3), now that #419 and #425 are in.@EagleBearerYS your adaptation to the current
DepthPlaneCopyis what the change is now (co-author), and so is yourBaseSliceCasein place ofmain's refusal case. @mrfelek I added your Diablo II shape as a case too, a D16 plane read asR16_UINTfrom base slice 1 (co-author on the test). It takes the same path, so this should cover that title as well.agc_driver_depth_plane_samplingand the rest of theagc_*suite pass on Windows. The debt entry indocs/dev/debt/libSceAgcDriver.mdsays what still throws.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T19:35:17Z.
Thanks, the base-slice cases and the debt line are what was needed. One part of the 10-11 review is still open: please pin the depth-plane views that must keep throwing (
BASE_ARRAYpastLAST_ARRAY, a cube withBASE_ARRAY != 0, a 2D view withBASE_ARRAY != 0) inDepthPlaneSampling.cpp.Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-13T21:08:02Z.
@MichonGoddijn231849 @oneandonlydean for the open point in the 10-11 review (pin the depth-plane views that must keep throwing in
DepthPlaneSampling.cpp), I wrote the cases on top of this PR's head (db77358c6): https://github.com/mrfelek/AnyPS5/tree/pr/depth-plane-refusals (one commit, bda61af82, +29 lines inDepthPlaneSampling.cpponly). Take it withgit cherry-pick bda61af82if it is useful.A new
RefusalCasebuilds the resource from a T# withDecodeTextureResource, sets the base slice and callsDepthSurfaceTexturedirectly (so it pins this code's own checks and not the descriptor parser's, which already rejects some of these shapes earlier), and expects the refusal message:Checked on Linux (RTX 3080 Ti, GCC 15.3.0):
agc_driver_depth_plane_sampling_testspasses with it,check_conventionspasses, and removing each production check in turn (thebaseArray > depthOrLastArrayterm, thecube ||term of the base-slice condition, and thebaseArray != 0term of the one-slice refusal inSampled) makes the matching case fail with "was not refused".AI-assisted; I reviewed the change and ran the tests.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:24:22Z.
@MichonGoddijn231849 mrfelek's
bda61af82(https://github.com/mrfelek/AnyPS5/tree/pr/depth-plane-refusals) covers the open point: it pins the three refusals and each case fails when its check is removed. Please cherry-pick it onto this branch.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T01:36:14Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL789docs/dev/debt/libSceAgcDriver.mdL36-37core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cppL318-321, L344-346core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL384-385core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cppL318-321, L344-346core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cppL318-321Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-14T08:32:55Z.
Cherry-picked @mrfelek's
bda61af82onto the branch (now its head, authorship kept).agc_driver_depth_plane_samplingpasses on Windows with it (RTX 5080). That should close the last open point of the 10-11 review.Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T13:11:11Z.
Heads-up for the rebase: against current
main(63fb0cd92) the only conflict is one hunk indocs/dev/debt/libSceAgcDriver.md; the code merges cleanly.mainadded the "SW_64KB_Z_X color targets" bullet directly under "Depth plane copies", so the resolution is to keep this PR's edited "Depth plane copies" bullet (the unchangedmainversion of it differs from the old base only by what this PR rewrites) followed bymain's new bullet.I merged this head locally on
main3e577edacfor a Diablo II: Resurrected run (Linux, RTX 3080 Ti): it builds and the ninedepthctest tests pass with it, and it is the step that takes the title past the base-slice sampling refusal. Just the docs line needs the rebase.AI-assisted; the runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T13:31:45Z.
Rebased onto main: only the debt file conflicted; kept your depth-plane copies bullet before main's SW_64KB_Z_X one. Full
ctestpasses here; the full build runs once main'sagc_driver_waterfall_imagesfix is in.