fix(agc): accept a GPU store of expanded HTILE words over native multisample depth #25561
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25561"
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:08:56Z.
What
A GPU store over a native multisample depth target's guest planes threw
external GPU writes over native multisample depth are not implemented, whatever it wrote. Resident Evil Village (PPSA01556) stores over the whole HTILE plane of a 4-sample D32 target with no stencil, and every word it leaves is0xfffc000f. That is the expanded HTILE word (expandedHtileWord, Mesa'sradv_get_htile_initial_val): the depth values are uncompressed in place, which is the state the native image already holds.DepthSurface::CheckCurrentnow waits for a pending GPU store over the HTILE plane of a target that has one (target.htileAddress != 0u; on a D32S8 target without HTILE the second range is the stencil plane, which stays refused). If every word it left is already in its expanded form (expandedHtileWord(word, target.htileStencil, depth | stencil)returns the word unchanged), the store is accepted: the native image is kept, and the HTILE plane's tracked generation and publication capture move to the stored words. Otherwise the refusal is recorded insampling.refusal, so it stays in force once the store has landed, as it did while the store was pending. Any other GPU store over the HTILE plane, and any GPU store over the depth or stencil plane, still throws the same message. Pending writes that are not stores keep the existing wait-and-check.On the console, resetting HTILE that held compressed tiles to expanded words exposes the depth plane's raw bytes for those tiles. The host keeps the native depth values instead. That differs only if the game reads depth it reset this way without rewriting it; this is not measured, and it is noted in the debt fragment.
Tested
Linux 7.3.5, Ryzen 9 7950X, RX 6650 XT, RADV Mesa 26.3.1, Release.
CheckExpandedHtileStoreinNativeMultisampleDepth.cpp, for each supported D32 sample count. A queued GPU fill of expanded words over the whole HTILE plane is accepted, and the sampled view still resolves to the native surface. A queued fill of another HTILE word, and a GPU store over the depth plane, are still refused. A second lookup after the accepted store still succeeds. Withmain'sDepthSurface.cppand this test,agc_driver_native_depth_stored_repeat_fillfails withexternal GPU writes over native multisample depth are not implemented.CheckExpandedWordsOverDepthPlane: expanded-looking words stored over the depth plane are refused.CheckExpandedWordsOverUniformStencil(inagc_driver_native_depth_uniform_planes, 2/4/8 samples): expanded-looking words stored over the stencil plane of a D32S8 target without HTILE are refused. At heade2b82392c7, 33 of 33 focused tests pass 3 of 3 runs with the layer inserted and 0VUID-; with only thehtileAddresscondition removed, this test fails.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.mainit stops earlier on the refusal #9950 removes). A temporary log at the refusal showed a GPU store over the whole 32 KiB HTILE plane of a 4-sample D32 target leaving every word0xfffc000f. With this change on top, that store is accepted. The title then stops on a later store that fills the same kind of plane with0x00000000, a fast clear to depth 0.0, which this PR does not cover.Independent Windows/AMD follow-up reported by Helldiverr: Radeon AI PRO R9700, driver 32.0.31044.16, Windows 11 and Khronos 1.4.363, head
e2b82392c7merged onto mainefd0479fa3asbf5276ccf4. The reviewer reports 35/35 focused tests passing in three merge runs, with the same queued-fill skip as main, actual layer insertion and zero VUID lines. The new uniform-stencil case checked 2/4/8 samples with none unavailable. Removing onlytarget.htileAddress != 0umade that case fail because the expected refusal disappeared; the other tests passed. These are contributor-reported synthetic-test results, not a native-title result or console measurement.Checklist
main; no other open PR changes this refusalNotImplemented_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-22T09:14:19Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
39f7de1a62c5c072b0a33eaa8eac05c177e42f09against basemain. Read the prepared description, commit list, diff, manifest, and all three changed files; traced the changed logic throughexpandedHtileWord, publication capture, and recorder write tracking. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
expandedHtileWordwith both depth and stencil aspects marked cleared, while the test covers depth-only D32 HTILE. Consider adding a stencil-in-HTILE case to exercise that branch.Not verified
The reported console behavior and test results were not independently verified. No checks were run on hardware or on a different host/device combination. All changed files listed in the manifest were read; none were excluded.
To get this to a good state
Nothing is required. Optional: add a test for an expanded HTILE store when stencil is encoded in HTILE.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T09:24:19Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and regression test support the described expanded HTILE store behavior.
What I ran
Reviewed head
0482bffc9a8bd30f049870604b3b758fd566f3b4. I read the prepared description, commits, manifest, diff, and all three changed files, then inspected the touched implementation and its supporting helpers. No tests or builds were run; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test execution, the reported console behavior, and the stated host and GPU test environment were not independently verified. No changed file was excluded:
DepthSurface.cpp,NativeMultisampleDepth.cpp, andagc-expanded-htile-store-over-native-depth.mdwere read. No separate exclusion manifest was present in the review bundle.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-24T23:15:29Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the focused review supports merging, with the console behavior noted as not measured.
What I ran
Reviewed head
e2b82392c77ebf42ed3ddf9c8377fec28695a6b9using the prepared diff andrepo_read.py. No tests were run by me; the test results in the description are author/contributor reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No programmatic checks were run. Console behavior, including the effect of resetting compressed HTILE tiles without rewriting depth, was not measured. The prepared bundle included full text for all three changed files;
files.jsonwas not available through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T04:39:30Z.
Review: COMMENTED
Actionable comments posted: 1
bbb21356-0f7c-4660-bd22-ed2856a258baReviewing files that changed from the base of the PR and between
c3ddd52daaandad0b2f57f6.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.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T04:54:57Z.
Review: APPROVED
Reviewed — looks good
The reviewed change safely narrows acceptance to settled GPU stores over an HTILE plane whose words are all expanded, while preserving refusals for other planes and values.
What I ran
Reviewed head
ad0b2f57f6f489efe6f54ebff955803426912c7busing the pinnedrepo_read.pyreader. No tests or builds were run; the test results in the description are author-reported.Files read:
DepthSurface.cpp(targeted ranges),agc-expanded-htile-store-over-native-depth.md, plusdescription.md,commits.md,manifest.json, anddiff.patch. The fullNativeMultisampleDepth.cpptext was excluded by the review-folder size rule; its changed hunks were reviewed indiff.patch.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The test file’s full text was excluded by the review-folder size rule; only its changed hunks in the diff were reviewed. Builds, tests, and console behavior were not independently verified.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T05:20:30Z.
Review: COMMENTED
1dbbf59f-d9b5-43e6-ac7c-e8f0cac5aed1Reviewing files that changed from the base of the PR and between
ad0b2f57f6and69ac0aefa5.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; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T06:00:27Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change has no verified blocking defect; runtime checks were not available in this review environment.
What I ran
Reviewed head
69ac0aefa56cd5a095b95e6f6e3feffd67e78840usingrepo_read.pyto read the prepared review bundle and targeted source context. No tests were run.Results
Findings
Blocking
None verified.
Non-blocking
docs/dev/debt/changes/agc-expanded-htile-store-over-native-depth.md:5).Not verified
description.md,commits.md,manifest.json,diff.patch; changed source context inDepthSurface.cpp; theexpandedHtileWordimplementation. The test file was excluded from the prepared full-text files because it was too large; its changed hunks were present in and reviewed fromdiff.patch. The debt fragment was read from its diff hunk.To get this to a good state
Nothing is required. The unmeasured console behavior is an optional follow-up.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T20:19:51Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
Actionable comments posted (1)
3d683e7e-c574-48a2-8d9e-78d18125732cReviewing files that changed from the base of the PR and between
69ac0aefa5and479e260eb2.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:18:39Z.
Review: COMMENTED
🏛️ Architecture findings (2)
Advisory architecture findings (2)
💬 Code review
Actionable comments posted (1)
13728285-3cb8-4db0-bbdd-beea85391d86Reviewing files that changed from the base of the PR and between
479e260eb2andb49cdd4b98.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T00:12:32Z.
Review: APPROVED
Reviewed — looks good
The change accepts only expanded HTILE stores on native multisample depth targets with HTILE; other overlapping GPU stores remain refused.
What I ran
Reviewed head
b49cdd4b98fbabeb75ecf6241e9e577905b2d925using the pinnedrepo_read.pyreader and the prepared diff. No tests or builds were run.Results
Negative control
Not run by this reviewer. The description reports that removing the HTILE-address condition makes the uniform-stencil test fail; that result was not independently verified.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Native-console behavior and the reported test runs were not independently verified. The prepared diff and targeted source context were reviewed for all three changed files; no excluded files were listed.
To get this to a good state
Nothing is required. If the reviewed head changes, review the new diff and rerun relevant non-compiling checks.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:31:41Z.
Review: COMMENTED
I followed the guest lease and accessibility check across the pending HTILE store and the baseline rebase after acceptance. The fixture checks that a second lookup still resolves the same surface and now checks a sampled value across the update. Please retain the sticky refusal cases for mixed words and changes outside the HTILE plane when rebasing the dependent clear-store work. The paired native-depth tests are queued on lavapipe, and the compressed-tile behavior remains documented as unmeasured on console.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T14:37:53Z.
Review: COMMENTED
Actionable comments
1acc5e02-8749-4e4d-aa09-7be3659c3546Reviewing files that changed from the base of the PR and between
b49cdd4b98and13a9e3c48b.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; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T14:49:31Z.
Review: APPROVED
Reviewed — looks good
The changed path accepts a pending GPU store only when it overlaps an HTILE plane and every stored word is expanded; other plane stores remain refused.
What I ran
Reviewed head
13a9e3c48b4ac6fdc725d3b257e729e74abca3a9using the pinnedrepo_read.pyreader. No tests or builds were run.Results
Reader output
Negative Control
Not run; no tests were executed in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
DepthSurface.cppat the reviewed head checks the HTILE address, waits for the store, validates expanded words, updates the tracked generation, and rebases publication.NativeMultisampleDepth.cppat the reviewed head covers accepted HTILE stores and refused depth and stencil stores.Not verified
The focused tests and Resident Evil Village behavior were not run by the reviewer. The full
NativeMultisampleDepth.cpptext was not bundled because of its size; its changed hunks and relevant invocation ranges were read through the pinned reader. No files were excluded by thefiles.jsonexclusion rules.To get this to a good state
Nothing is required.
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.