Skip to content

feat(agc): sample depth plane arrays from a later base slice - #1186

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
MichonGoddijn231849:feat/depth-plane-array-base-slice
Oct 14, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
MichonGoddijn231849:feat/depth-plane-array-base-slice

Conversation

@MichonGoddijn231849

@MichonGoddijn231849 MichonGoddijn231849 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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 PPSA04264 (01.005) runs with this change on the combined gta-v/testing branch (Performance mode, the prologue).
  • On main 0214069 (2026-10-13): agc_driver_depth_plane_sampling passes 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 as R16_UINT from base slice 1), which replace main's refusal case. The whole agc_* suite passes on Windows (483 tests).
  • Resident Evil Village (PPSA01556) gets past its first-scene stop with this change (EagleBearerYS), and Diablo II: Resurrected (PPSA03912) reaches its main menu with the same change (mrfelek).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • 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(agc): depth planes sampled as 2D arrays, cubes and integer views #425 is merged)
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

@MichonGoddijn231849
MichonGoddijn231849 force-pushed the feat/depth-plane-array-base-slice branch 2 times, most recently from 665e63a to e53b2d0 Compare October 7, 2026 18:22
@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 7, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@MichonGoddijn231849
MichonGoddijn231849 force-pushed the feat/depth-plane-array-base-slice branch from e53b2d0 to fd0ddc6 Compare October 8, 2026 16:06
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@fisherjoey

Copy link
Copy Markdown
Contributor

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 main 4b005b2 (plus #861, which this title needs to start on Linux) that aborts:

compute shader 0x2488ab600: AGC graphics: sampling the depth plane of depth surface 0x2a4700000 (1024x1024, vk format 126)
as a 1024x1024 texture of guest format 22 (vk 100), tile mode 4, dimension 2, levels 0-0, slice 0 is not implemented
(T# 02a47000 c1600000 00ffc0ff d1800924 0000004f 00700000 ...)

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.

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor Author

@fisherjoey thanks, a shadow-map read from a later base slice after NEW GAME is exactly the case this is for.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

Pull request Conflicting files (lines on main) Same exports Same new files
#454 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L789
docs/dev/debt/libSceAgcDriver.md L36-37
#4722 core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cpp L318-321, L344-346
#4873 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L384-385
core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cpp L318-321, L344-346
#5467 core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cpp L318-321

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor Author

Cherry-picked @mrfelek's bda61af82 onto the branch (now its head, authorship kept). agc_driver_depth_plane_sampling passes on Windows with it (RTX 5080). That should close the last open point of the 10-11 review.

@mrfelek

mrfelek commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Heads-up for the rebase: against current main (63fb0cd) the only conflict is one hunk in docs/dev/debt/libSceAgcDriver.md; the code merges cleanly. main added 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 unchanged main version of it differs from the old base only by what this PR rewrites) followed by main's new bullet.

I merged this head locally on main 3e577ed for a Diablo II: Resurrected run (Linux, RTX 3080 Ti): it builds and the nine depth ctest 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.

MichonGoddijn231849 and others added 3 commits October 15, 2026 02:27
A T# reading a depth surface's planes as a 2D array whose BASE_ARRAY is past slice 0 views the plane
copy from that slice (the copy holds slices 0 to LAST_ARRAY), instead of being refused. A 2D binding
of such a plane array reads its base slice through a one-slice view. Resident Evil Village
(PPSA01556: a D32 array read as R32F from slice 1) and Diablo II: Resurrected (PPSA03912: a D16 array
read as R16_UINT from slice 1) stopped on the refusal.

Rebased onto main from EagleBearerYS's adaptation to the current DepthPlaneCopy.

Co-Authored-By: EagleBearerYS <75296019+EagleBearerYS@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
agc_driver_depth_plane_sampling's refusal case becomes base-slice cases: a D32 2D array from base
slice 1 reads its slices 1 and 2, and through a 2D shader image slice 1; a D16 plane array read as
R16_UINT from base slice 1 reads slice 1 (the integer path Diablo II takes).

Co-Authored-By: EagleBearerYS <75296019+EagleBearerYS@users.noreply.github.com>
Co-Authored-By: mrfelek <17274927+mrfelek@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A base slice past the last slice, a cube from a base slice and a 2D view with a
base slice are refused by DepthSurfaceTexture. Each case fails when its check is
removed.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Rebased onto main: only the debt file conflicted; kept your depth-plane copies bullet before main's SW_64KB_Z_X one. Full ctest passes here; the full build runs once main's agc_driver_waterfall_images fix is in.

@oneandonlydean
oneandonlydean force-pushed the feat/depth-plane-array-base-slice branch from bda61af to f8aa904 Compare October 14, 2026 13:31
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@oneandonlydean
oneandonlydean dismissed adriadam10’s stale review October 14, 2026 17:04

Met: tests for the base-slice path and the refusals, plus the debt line, are in.

@oneandonlydean
oneandonlydean merged commit 19e020a into boykopovar:main Oct 14, 2026
8 checks passed
AlxcBTW pushed a commit to AlxcBTW/anyps5-roadmap that referenced this pull request Oct 16, 2026
…0a27 (#76)

boykopovar/AnyPS5#1186, #5779, #5205, #5003 and #5216 are merged; the Game bring-up thread (discussion 5146) reports In game on main with two runs of about 40 presents per 10 s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants