fix(agc): clear native multisample depth on a GPU store of clear HTILE words #25574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25574"
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 JJenkx on 2026-11-22T09:32:27Z.
What
Follow-up to #25561. A GPU store over a native multisample depth target's HTILE plane, with no clear noted for it, still throws
external GPU writes over native multisample depth are not implementedwhen its words are not expanded. Resident Evil Village (PPSA01556) clears depth this way: after the expanded store #25561 accepts, it stores0x00000000over the whole depth-only HTILE plane of a 4-sample D32 target whose clear depth is 0.0. For depth-only HTILE that word means every tile is cleared to depth 0.0.DepthSurface::CheckCurrentnow treats such a store as a clear when, once it lands, every HTILE word proves the target's clear value (htileProvesClear, depth 0.0 or 1.0). The native depth is cleared to that value withRecordClearValue(depth aspect only), and the HTILE plane's tracked generation and publication capture move to the stored words, as #25561 does for expanded words. This applies only to depth-only HTILE, and only when no clear is already armed or pending on the target; otherwise the existing clear tracking keeps the store refused. Depth-only HTILE carries no stencil state, so a separate stencil plane is left as it is. Stores whose words prove neither a clear nor an expanded surface keep the sticky refusal from #25561.Depends on: #25561 (this branch is stacked on it; the diff against
mainincludes its commit).Tested
Linux 7.3.5, Ryzen 9 7950X, RX 6650 XT, RADV Mesa 26.3.1, Release.
New test case
CheckGpuHtileClearStore(driver-path fixture), for clear depth 0.0 and 1.0 at each supported sample count: depth is drawn at 0.25, a GPU store of the clear-proving HTILE word is queued with no clear note, every sample then reads back the clear depth, and a later draw is sampled as drawn. With #25561'sDepthSurface.cppand this test,agc_driver_native_depth_driver_pathfails withexternal GPU writes over native multisample depth are not implemented.Focused suite:
ctest -R 'multisample_depth|native_depth|depth_surface|htile', 41 of 41 pass with the Khronos validation layer inserted (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), 0VUID-lines. Without the armed-clear condition,agc_driver_native_depth_separate_stencilfailed (a GPU store over an armed HTILE clear was taken as a second clear), so the condition is required.In #25561's
CheckExpandedHtileStore, the store that must still be refused now uses0x00000000, which proves neither a clear (the fixture clears to 1.0) nor an expanded surface;0xfffffff0is a clear word and is now accepted as one.Title: Resident Evil Village (PPSA01556), with #9950 merged locally (it needs #9950 to reach these stores), pristine save, Cross every 8 s from 20 s after the first pad read, 180 s runs:
main+ #9950external GPU writes ...(the expanded store)main+ #9950 + #25561external GPU writes ...(the0x00000000store)main+ #9950 + #25561 + this PRThe title menu runs at about 2 FPS in these runs (60 FPS in the first 30 s), so there is a separate performance problem after this point; this PR makes no performance claim.
Checklist
main; stacked on #25561, no other open PR changes this refusal (#6808 handles CPU-written clear HTILE, not GPU stores)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)AI-assisted: yes
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T10:05:09Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the code and added regression cases support the described handling of clear-proving and expanded HTILE stores.
What I ran
Reviewed head
47c6d0049fa77c28a6b461f9b3b98d93a942ebc8from the prepared diff and read the changed lines in all four changed files, plus the relevant HTILE proof, clear recording, publication rebasing, and fixture context throughrepo_read.py. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
files.jsonwas not available as a review-folder document; the reader listing and manifest confirmed the four changed files, all included and read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T09:25:13Z.
Review: COMMENTED
Reviewed — comments
The full diff and all four changed files were read; implementation looks consistent with the stated HTILE clear and expansion handling, but no checks were run, so a formal decision is not justified.
What I ran
784df4ff678345ad8225a25026577414a3d38cc6and the prepared diff. No commands or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T10:21:18Z.
Review: COMMENTED
Actionable comments posted: 4
733890fe-5792-42d8-b1ef-9bf770ecfad8Reviewing files that changed from the base of the PR and between
f5b7e1d1acand64b0182e01.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppdocs/dev/debt/changes/agc-expanded-htile-store-over-native-depth.mddocs/dev/debt/changes/agc-gpu-htile-clear-store.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T10:31:02Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change at head
64b0182e019e9bde41f26c23e735e3edca776c9fhandles pending depth-only HTILE stores that prove a clear and preserves refusal for unrecognized stores; I did not run tests, so the supplied test results remain author-reported.What I ran
Read the prepared PR description, commits, manifest and diff, plus all four changed files at the pinned head. Used repository reader searches and targeted reads for the HTILE proof, clear recording, publication rebasing and regression cases. No tests or other commands were run.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports a focused 41-test pass with validation and two 180-second Resident Evil Village runs, but I did not independently verify them. The full implementation and regression-test files were not read beyond the relevant sections; unrelated behavior in those files was not reviewed.
review/files.jsonwas unavailable through the reader, so excluded-file details were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T21:03:25Z.
Review: COMMENTED
🏛️ Architecture findings (2)
Advisory architecture findings (2)
💬 Code review
Actionable comments posted (1)
8c1b5958-f2bd-4018-a393-3ad87c5a54ceReviewing files that changed from the base of the PR and between
64b0182e01and0bd4c78217.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T23:22:22Z.
Review: COMMENTED
🏛️ Architecture findings (3)
Advisory architecture findings (3)
💬 Code review
Actionable comments posted (2)
054da0bd-683b-4b72-aa49-51ec71a59b1fReviewing files that changed from the base of the PR and between
0bd4c78217and04e5ef8523.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppLimit details: You’ve used all 10 included reviews currently available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T00:10:32Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at
785f762f1de2c848e1f0088e83f9fa5fb156970ehave no verified blocking findings and support merging.What I ran
Inspected the prepared diff and every added line in the four changed files. Used
repo_read.pyagainst the pinned head for source context. No build or runtime test was run; no merged preview was performed.Results
Negative control
Not run; the regression tests require the built AGC test executable.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Runtime tests, hosted CI, and the reported console runs were not independently verified. The reviewed files were
DepthSurface.cpp,NativeMultisampleDepth.cpp,agc-expanded-htile-store-over-native-depth.md, andagc-gpu-htile-clear-store.md; all four were reviewed.files.jsonlists no excluded files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:31:39Z.
Review: COMMENTED
The current head updates the initial clear depth when the metadata is observed before the native image exists, and records a depth-only clear after layout. Please verify both initialization states with readback, including that the stencil values survive on a target with its own stencil plane. The accepted case remains limited to a pending store on this branch, which the debt fragment distinguishes from #25716. The paired native-depth tests are queued on lavapipe.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.