fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared #6297
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6297"
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 Gashrod1 on 2026-10-15T09:52:17Z.
What
createFilled(a 2D MSAA texture sampled before any draw rendered to it) modeled only the S 4 KiB, S 64 KiB and R 64 KiB swizzles, and refused any texture with metadata. DAVE THE DIVER (PPSA19115) samples a 2-sample 1920x1080 Z_X depth texture (format 22,ITERATE_256) at its first frame, before any draw, and stops on currentmain:MultisampledColorBytesand the guarded range now take the block size from the mode (MultisampledBlockLog2). Z_X and D_X surfaces with no metadata then load the value their memory repeats, as S and R already did. S_X is still refused.HtileMetadataBytes):(w & 15) == 15): the memory holds the values, and the existing uniform-memory check applies.CPU and GPU writes into the color memory after the import are handled as for the existing color import; this only widens which textures it accepts.
Tested
Unit and GPU tests, Linux, Intel Alder Lake-P iGPU (Mesa 26.2.4), on
1db84d574:agc_driver_sample_multisample_target, with new cases: uniform Z_X and D_X memory loads its value; Z_X with all-zero HTILE over memory of other values loads 0.0; a partial HTILE fill is refused, then a whole fill of 0 loads 0.0 again; an all-expanded HTILE loads the memory's value; a mixed HTILE is refused; D_X with metadata and S_X are refused.agc_driver_graphics:MultisampledColorBytesof the 4x 100x100 4-byte case for Z_X and D_X.agc_driver*test passes exceptagc_driver_multisample_fill_host_only, which fails the same way onmain(vkWaitSemaphoresKHR-4). Underctest -j6,agc_driver_depth_fast_clear_submitand the twoagc_driver_gated_dispatch_capturetests failed once and pass alone.DAVE THE DIVER (PPSA19115), Windows 11, NVIDIA GeForce RTX 5060 (596.36), libs only changed between runs:
ab9a47684+ #5496 (008f91501, the merged head)tile mode 4refusal abovenative multisample depth metadata fill transition is not implementedThe frame 17 stop is the D32S8 native depth target sharing this HTILE (2 samples, stencil in HTILE), discussed in #5554. On
1db84d574this branch builds on Windows (libs and relinker); the title was not run again on it.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:18:18Z.
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.
main)core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL677core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL292core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL259-260, L348, L350-351, L372-374core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL22, L508-509, L788core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL259-260, L348, L350-351, L372-374core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL22, L508-509, L788core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL259-260, L348, L350-351, L372-374core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL22, L508-509, L788core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL259-260, L348, L350-351, L372-374core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL22, L508-509, L788core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppL259-260, L348, L350-351, L372-374core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppL22, L788Some 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.
core/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppImported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-15T12:30:55Z.
Death Stranding 2 (PPSA02015) hits the case this fixes. On a local stack (current main plus what it needs to get that far: PR 5426, PR 5855, three branches of mine and a local diagnostic switch), a compute shader stops it at about 170 s with
sampling the 1920x1080 multisampled texture 0x82e9b40000 of 4 samples, which no draw rendered to and whose tile mode 4 has no modeled multisampled color footprint, is not implemented.With this PR cherry-picked on top, that throw is gone and the shader runs; the title goes on to a later stop in another compute shader (PR 6277 gets it past that one too).
Your tests (the six multisample ctests) pass here on an RTX 5080, a Radeon 610M on RADV and lavapipe, with the PR merged onto main
7a22c4302.Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-15T16:54:08Z.
Another title with the same stop: SONIC SUPERSTARS (PPSA06888) samples a 1920x1080 2-sample texture no draw rendered to, in the Z64KBX layout:
Setup: Windows 11, MinGW-w64 GCC 15, Release, AMD Radeon RX 5700 XT. A local change with the same block rule as this PR (Z64KBX treated like
Standard64KBandRenderTargetincreateFilledandMultisampledColorBytes) got the title past it on 14 October, into gameplay. I checked the rule against Addrlib'sComputeThinBlockDimension, which uses only the block size, element bytes and sample count. So I'm not opening a PR of my own for it.I could not confirm this PR on the title yet. On
mainec1193dc3plus #5865, #5882 and this PR (c63485076), the title now stops earlier, about 30 s in, at the native multisampled depth check from #5496; details on #6300. This PR's own path is not reached in that run.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T19:56:01Z.
Review: COMMENTED
NVIDIA run of the tests. The description has Intel for the tests and NVIDIA only for the title run.
Ubuntu 26.04 (kernel 7.0.0-38), NVIDIA GeForce RTX 3070, driver 595.99.02, GCC 15.2, Release,
BUILD_TESTING=ON,ANYPS5_GPUset to the 3070 (the log showsSelected GPU name=NVIDIA GeForce RTX 3070 vendor=0x10de). Headc63485076merged ontomain44df21632, no conflicts.main, both tests fail as described:agc_driver_graphics:a 4x 100x100 4-byte surface of another 64 KiB swizzle does not span 2x2 64 KiB blocks.agc_driver_sample_multisample_target:sampling the 16x16 multisampled texture ... of 4 samples, which no draw rendered to and whose tile mode 4 has no modeled multisampled color footprint, is not implemented.ctest -R "^agc" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64|display" -j1: 592 of 593 pass, with the same 3 skips asmain. The failure isagc_driver_store_over_untracked, which also fails on unmodifiedmainon this machine: 9 of 10 runs with other builds running, all withthe result did not reach a block the CPU left alone. It is the same test as #6347 and #6383, which report it on Windows. On an idle machine,mainpasses 593 of 593.Not run: any title.
GPUs tested: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, Ubuntu 26.04 (kernel 7.0.0-38)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-16T08:08:53Z.
@billythemenace2 thanks for checking the Z64KBX rule against Addrlib. Your next stop is answered on #6300. In short, #6423 shows the real refusal, and the D32S8 targets without HTILE stencil metadata are a follow-up.
@jotitadev thanks for the NVIDIA run.
agc_driver_store_over_untrackedis the known flaky test from #6347 and #6383, and it is unrelated to this change.AI-assisted: yes