Repository navigation
fix(agc): take a whole native depth publication as an in-place expand - #25872
Conversation
A native multisampled depth target with HTILE accepted a descriptor without metadata only after an observed in-place expand draw; any other such read threw "native multisample depth sampled metadata or XOR mismatch". Publishing the target to guest memory writes every HTILE word expanded and the planes from the host samples, which is the state an in-place expand leaves. When every plane was committed whole and unchanged by the guest, the target is now taken as expanded, until the same clears and fills that end an expand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change was reviewed at head b3da3af97599ac0fd10d1f608930937318bb733c; the code supports marking a multisampled depth surface expanded after whole, unchanged publication, and I found no verified blocking defect.
What I ran
Read the prepared diff and the three changed files at the pinned head, plus the relevant DepthSurface.cpp state transitions. No commands or tests were run in this review.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All changed files read |
| Tests | not run | No tests run in this review |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and runtime behavior were not independently verified. The PR description reports test results and notes that later recompression, other GPUs, Linux, and console behavior were not tested.
Files read: DepthSurface.cpp, NativeMultisampleDepth.cpp, and fix-agc-expanded-after-whole-depth-publication.md. Files excluded: none; all three changed files were included in the review bundle and read. files.json was not present as a review document; the reader’s listing confirmed the changed-file set and inclusion status.
To get this to a good state
Nothing is required.
|
NVIDIA run on Linux: no regression in the multisample, native depth, HTILE, FMASK and CMASK tests, including Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base f220c22, head is b3da3af.
Every Vulkan test's log selects the RTX 3070 and shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
Correction: this run is weaker evidence than it reads. My gate selected only Windows AMD run of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, AMD Radeon RX 6700 XT, driver 32.0.21045.29003.
AI-assisted: yes. |
|
Full-executable rerun, replacing my earlier single-test run on this PR. This time every test that Windows AMD run of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, AMD Radeon RX 6700 XT, driver 32.0.21045.29003.
AI-assisted: yes. |
|
A Windows + NVIDIA run of the current head b3da3af, next to the earlier NVIDIA Linux and AMD Windows runs. No regressions. The extended publication case passes, and it fails against main's System: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 4060 (10de:2882, Ada), driver 621.01, Intel Core i5-12400F, WinLibs GCC 15.2.0 r7 (UCRT), Release, Trees, each a full build:
Run:
Not tested: Linux, and a title. AI-assisted: yes (Claude Code). It merged the PR, ran the three builds and the test sets, and drafted and posted this comment. |
|
Head Code.
Stacking.
Negative control. In one build, I combined the tests of #25867 and #25871-#25874 with GPU.
Every log shows the AMD Radeon AI PRO R9700 as the device. What this adds. The other runs were on an RX 6800 (by the author) and an RX 6700 XT, both RDNA2, and on an RTX 3070 and an RTX 4060, the RTX 4060 run with a negative control. This is the first RDNA4 run, on a newer Validation.
Host:
AI-assisted: yes |
|
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.
|
What
A native multisampled depth target with HTILE accepted a descriptor without metadata only after an observed in-place expand draw. Any other such read threw
native multisample depth sampled metadata or XOR mismatch. Publishing the target to guest memory (PublishToGuest) writes every HTILE word expanded (expandedHtileWord: ZMask 15, and SMem 3 with the stencil in HTILE) and the planes from the host samples, which is the state an in-place expand leaves.When every plane was committed whole (no page kept from the guest, and each read back equal to what was published), the target is now taken as expanded, until the same HTILE clears and fills, plane fills and clear draws that end an expand.
Changes
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:PublishToGuestmarks the target expanded after such a publication.core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp(the reuse case ofagc_driver_native_depth_publication): after a whole publication of a D32S8 owner with HTILE, a descriptor without metadata is sampled.docs/dev/debt/changes/fix-agc-expanded-after-whole-depth-publication.md: a new entry, "Native multisampled depth publication as an in-place expand".Tested
Windows 11 Pro (build 26300), Intel Core i9-9900K, AMD Radeon RX 6800 (AMD driver 26.10.1, Windows driver 32.0.21045.16010, Vulkan 1.4.315), MinGW-w64 GCC 15.3.0, Release,
main66668eb.Focused set (as in #25871) with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(1.4.363) andVK_LOADER_DEBUG=layer:main66668ebVUID-linesWithout the fix (
main'sDepthSurface.cppwith this branch's test),agc_driver_native_depth_publicationfails withAGC graphics: native multisample depth sampled metadata or XOR mismatch.--publication-without-htileand--bare-depth-publicationpass with the fix.Forza Horizon 5 (PPSA22327 01.685.672), local stack of open PRs:
0xfffff3ff, but no expand draw was seen on the 4x target; the game's expand draws were on a single-sample surface at the same address.py -3 tools/check_conventions.py --base origin/mainandpy -3 tools/debt_fold.py --checkpass.py -3 tools/pr_overlap.py --branch fix/agc-expanded-after-whole-depth-publication(2,360 open PRs) found no overlap among mergeable PRs. Twenty-one PRs that conflict withmainwere searched by hand; #9950 changes which aspectsexpandedHtileWordexpands for a stencil owner, and none marks the target expanded.Not tested: a later draw that recompresses tiles is not observed (as for the expand draw), other GPUs, Linux, console behaviour.
Rebased onto
mainf220c22 (394 commits, none touching the files this PR changes, no conflicts). On the rebased commitcheck_conventionsanddebt_fold --checkpass. All eight PRs merged together on f220c22, the focused tests of all eight with the same environment:main182 passed / 0 failed, validation layer inserted 242 times, 0VUID-lines; the eight together 188 passed / 0 failed (the six new tests added), inserted 250 times, 0VUID-lines.Related
Part of the Forza Horizon 5 (PPSA22327) bring-up, #25152. The game hits these stops one after another, so these PRs were found and tested together on one stack: the other open PRs the game needs (#24960, #24994, #25151, #23688, #23545, #21479, #11825, #23778, #21155, #22306, #21199) plus the PRs below. Each one stands alone: it applies to
mainby itself, needs none of the others to build or pass its tests, and merges cleanly with every other one.fix/agc-materialize-cold-native-fmask: cold native FMASK pages read as stored after a first touchfix/agc-multisample-read-single-sample-depth: multisampled read over a single-sample depth surfacefix/agc-claim-retires-memory-backed-msaa-copy: memory-backed multisampled copy treated as a host-only aliasfix/agc-skip-no-op-htile-hiz-patch: HTILE Hi-Z patch dispatch that writes nothingfix/agc-sample-htile-stencil-after-expand: stencil kept in HTILE read without metadata after an expandfix/agc-htile-clear-supersedes-plane-writes: plane writes before a whole HTILE clearfix/agc-read-unwritten-htile-stencil-from-memory: stencil plane read from memory for an unwritten native targetChecklist
main; no other open PR implements the same functionsNotImplemented_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)mainand this change, 0 VUIDs🤖 Generated with Claude Code