fix(agc): read single-sample views of native multisample depth from guest memory #16880
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16880"
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 muhmuhkuh on 2026-11-07T19:49:26Z.
What
A single-sample descriptor at the base of a native multisample depth surface the sampling path imported throws
native multisample depth sampled identity or format mismatchonce a draw has written the surface.DepthSurfaceTexturetakes every descriptor at the base of an owner into the native path, and the owner stays resident after it publishes its samples, so every descriptor there has to be the owner's own 2D MSAA view. A one-sample read of another format or extent over the same memory aborts. Death Stranding 2 (PPSA02015) reads its D32 depth target this way, once the publication of #9950 lets it get that far.Such a descriptor now reads the guest bytes through the ordinary texture path, the way the console reads the surface's memory through any descriptor. If the host wrote the surface since its last publication, the owner publishes first (
PublishForGuestRead, which does nothing for an owner the host has not written and refuses while a multisampled colour target is being acquired). The owner stays and keeps serving its own descriptor; a later draw into it is published again before the next such read.Still refused: a 2D MSAA descriptor of another format, extent or sample count, a wrong XOR, layout or metadata, and every read of an owner that is not sampling-eligible. Each refusal now names the descriptor's and the target's format, extent, samples, dimension, swizzle mode, XOR and metadata. The debt entry records what stays unmeasured: a descriptor of another surface bound in the same draw that binds the depth reads the depth as it was before that draw.
Relation to other open pull requests
mainpublishes a bare D32 owner (no stencil, no HTILE) sincebareDepthTarget. This change adds the publication of a D32 owner with HTILE (its depth plane, and the HTILE plane expanded for the depth aspect only) and the single-sample read. #9950 also publishes D32 with HTILE; whichever lands second rebases.Relation to #16365
#16365 is merged.
GuestHoldsSamplesstays forPublishedUnderStorage; this change no longer calls it fromDepthSurfaceTexture, where every sampling-eligible owner now takes the guest read path and publishes first when the host wrote it.Tested
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3080 Ti, driver 610.88, MinGW-w64 GCC 15.2.0, Release with tests,
mainbb86118e0fand this branch at bd6552b5e9a, built on the same machine.agc_driver_native_depth_single_sample_reads(--single-sample-reads),agc_driver_native_depth_clearsand the changed refusal check: as described above.mainfb075eb332with #9950); not repeated on the current base.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationwithVK_LAYER_PATHat the Khronos validation layer,ctest -Voveragc_driver_native_multisample_depth,agc_driver_native_depth_*andagc_driver_msaa_layout:main: 32 tests, 32 passed, 1 of them skipped (agc_driver_native_depth_driver_queued_fill).was not found but was requestedor aVUID-.tools/check_conventions.py --base origin/main: no errors.main. On our downstream stack, which carries the same publication and sampling import, Death Stranding 2 gets past this refusal and stops later.Checklist
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)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:04:31Z.
Review: COMMENTED
The Intel cell, plus a second NVIDIA one. Head
5820a68f8amerged ontomain302864d48c(clean), withmainfrom the same build directory as the control. Windows 11 x64, WinLibs GCC 15.2.0 r7, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -R '^agc_driver_native_depth_', 3 runs per GPU.mainstencil_view,uniform_planes,publicationfail (#16883)single_sample_readspasses 3 of 3; the same three asmainfail, nothing newSo the new single-sample read path works on the Intel iGPU too, and the remaining Intel failures are the known stencil sample-shadow ones from #16883, which this PR doesn't touch. Not run with
VK_LAYER_KHRONOS_validation.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:29:10Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the portions inspected; the review is incomplete, so a formal approval is not justified.
What I ran
Reviewed head
bd6552b5e9a0ae4f7e1b3234f74dd01eda79722dusing the prepared diff and pinned repository reader. No build or tests were run.Results
Findings
Blocking
None identified in the portions inspected.
Non-blocking
None.
Not verified
Read
description.md,commits.md,manifest.json(through line 200),diff.patch(through line 481),README.md, the changed CMake lines, targeted ranges inDepthSurface.cpp, and targeted lines indocs/dev/debt/libSceAgcDriver.md. Did not read every added line inNativeMultisampleDepth.cppor the debt file, or all changed context inDepthSurface.cpp; the manifest indicates four changed files, all included. The author reports Windows 11, NVIDIA RTX 3080 Ti tests, validation-layer runs, and convention checks; these were not performed by this review. PS5 behavior is not verified.To get this to a good state
Nothing is required. Optional: complete the review of the unread added lines and run the reported checks before deciding whether to approve.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T18:22:08Z.
Review: APPROVED
Reviewed — looks good
The reviewed change adds single-sample guest-memory reads for eligible native multisampled depth owners and keeps the owner resident; I found no verified blocking defect in the inspected code.
What I ran
eaae56d8a4a366d7bd0854fd121fade195d8b8c6.repo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not read every line of the two large changed C++ files, run the tests, or verify the claimed hardware behavior. The changed files were
DepthSurface.cpp,agc_driver_native_multisample_depth_tests.cmake,NativeMultisampleDepth.cpp, anddocs/dev/debt/libSceAgcDriver.md; all four are listed as included in the review manifest. No excluded files were listed in the available file listing.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T06:25:40Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code supports merging, with remaining console behavior documented as unmeasured.
What I ran
Reviewed head
4a26118343bc865f8b7b6034358cebfa946c1b6a. No commands or tests were run;repo_read.pywas not invoked. Readreview/description.md,review/commits.md,review/manifest.json,review/diff.patch,review/README.md, all four changed files in the repository, and the changed-line ranges in the two source files. No changed files were excluded.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author's Windows/NVIDIA test results and downstream title behavior were not independently run. PS5 equivalence, including expanded HTILE interpretation and single-sample reads, remains unmeasured as documented. The changed-line ranges in
NativeMultisampleDepth.cppanddocs/dev/debt/libSceAgcDriver.mdwere inspected in context; no repository test suite was executed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T08:57:18Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the findings below are optional.
What I ran
Reviewed head
8c399369803a124bb57c14beb52324a42eb29fcbusing the prepared review bundle andrepo_read.py. No commands or tests were run; no merged-preview check was performed.Results
Findings
Blocking
None.
Non-blocking
Not verified
No tests, builds, or console behavior were run independently. The author reports Windows 11/Vulkan test results in
description.md; those results were not independently verified. The changed files read werecore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake,core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp, anddocs/dev/debt/libSceAgcDriver.md. All four files listed as reviewed inmanifest.jsonwere included. No excluded changed files were listed.To get this to a good state
Nothing is required. Optional: add a regression case for a single-sample read of an ineligible owner.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T04:46:40Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed logic and added test cases are consistent with the stated guest-memory read behavior; execution checks were not run in this review.
What I ran
Read the prepared diff, description, commit list, manifest, and changed code at head
9b78127792477267a139210c1552727d971eed41. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and physical-console behavior were not verified. Read the description, commits, full diff, manifest, and changed code in
DepthSurface.cpp,agc_driver_native_multisample_depth_tests.cmake,NativeMultisampleDepth.cpp, and the debt note. The full text ofNativeMultisampleDepth.cppwas excluded from the review folder; its changed hunks were available in the diff and targeted ranges were read throughrepo_read.py. Other unchanged portions of that file were not read. Test outcomes in the description are author-reported.To get this to a good state
Nothing is required. Optional: run the reported focused test suite on this head and verify the behavior on console hardware.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T17:53:12Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review evidence supports merging.
What I ran
Reviewed head
b592e66974895842277c379e88b92a01ce0d2d4eusing the prepared diff and pinned repository reader. No build or tests were run by me.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build, tests, and runtime behavior were not independently verified. The full text of
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppwas excluded from the review folder; I read the changed test regions through the reader. Other changed files were included and inspected. The author reports the Vulkan test runs and convention check in the description; those are not runs performed by me.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T20:15:23Z.
Review: COMMENTED
Actionable comments posted: 1
9bde16ff-6c0d-47d1-a4fa-eab2bc4c19f6Reviewing files that changed from the base of the PR and between
520d66172aand479499d826.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppdocs/dev/debt/changes/agc-single-sample-reads-of-multisample-depth.mddocs/dev/debt/changes/storage-import-touch-publication.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T20:29:52Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes support the stated single-sample guest-read behavior, but tests were not run, so a formal approval is not justified.
What I ran
Reviewed head
479499d8264b800c49fefbe4ae6bf7d11b9a18c1using the pinnedrepo_read.pyreader. No test or build commands were run.Results
Negative control
Not run; no test execution environment was available.
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims are based on the reviewed changes at DepthSurface.cpp and targeted test code at NativeMultisampleDepth.cpp.
Not verified
Tests, build, and physical-console behavior were not verified. Read the prepared description, commits, manifest, diff, and targeted portions of all six changed files.
NativeMultisampleDepth.cppwas excluded from the prepared full-text bundle; its relevant changed regions were read through the reader. The ruling file was not read, as directed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T08:28:29Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the evidence inspected supports merging, with the console behavior documented as unmeasured.
What I ran
0252a0c16ce65793cade71c53c0f35a5d348f3a3usingrepo_read.pyto read the prepared review bundle and targeted source ranges. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
description.md,commits.md,manifest.json,diff.patch, and the changed source ranges inDepthSurface.cpp,NativeMultisampleDepth.cpp,SampleMultisampleTarget.cpp,agc_driver_native_multisample_depth_tests.cmake, and both changed debt documents. The manifest marksNativeMultisampleDepth.cppas excluded from the review folder due to size; targeted ranges were read from the pinned repository head. No other changed files were excluded.To get this to a good state
Nothing is required. The optional follow-up is to validate the documented console behavior on PS5 hardware.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T17:55:09Z.
Review: APPROVED
Reviewed — looks good
The reviewed change routes eligible single-sample reads through published guest memory, preserves the resident multisample owner, and has no verified blocking findings.
What I ran
Reviewed head
356d97bc451f8e64ee534f93866cba5d224fd1e2. I inspected the prepared description, commits, manifest, diff, and changed code; no build or tests were run. The test results in the description are author-reported.Results
Negative control
Not run; no tests were run during this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Read changed code in all four manifest-reviewed files:
DepthSurface.cpp,agc_driver_native_multisample_depth_tests.cmake,NativeMultisampleDepth.cpp, andagc-single-sample-reads-of-multisample-depth.md. The fullNativeMultisampleDepth.cppwas not read; its changed sections and relevant command dispatch were inspected throughrepo_read.py.files.jsonlists no files excluded by rule. Builds, tests, hardware behavior, and the author-reported test results 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-30T18:02:27Z.
Review: COMMENTED
Actionable comments posted: 1
c0ed1887-eace-48fd-90d9-63d021419cd9Reviewing files that changed from the base of the PR and between
0252a0c16cand356d97bc45.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppdocs/dev/debt/changes/agc-single-sample-reads-of-multisample-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 coderabbitai[bot] on 2026-12-01T08:54:57Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
0ed2d775-7ac4-40ba-990f-bb7d90b36c66Reviewing files that changed from the base of the PR and between
356d97bc45and46912207e3.core/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-01T08:57:46Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed changes route eligible single-sample depth reads through guest memory after publishing host writes; one test portability point is optional.
What I ran
Reviewed head
46912207e3e60b59d2c3c26ca366b2db482db11f. No merged-preview check was run. I inspected the changed hunks withrepo_read.pyat the pinned head; no tests, builds, or compilation were run.Results
Negative control
Not run; no source mutation or test execution was performed.
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp:5863: the new test requires D32 4x support and fails if the device lacks it, while the subsequent sample-count loop treats unsupported configurations as unavailable. Consider returning the test's skip code when the required 4x capability is absent so this optional Vulkan test does not fail on devices that cannot exercise it.Sources
Not verified
No tests or builds were run. PS5 hardware behavior and the reported Windows/NVIDIA test results were not independently verified. The large execution test file was read only around its changed hunks. All four files listed under
files.jsonas reviewed were covered; none were listed as excluded.To get this to a good state
Nothing is required.