fix(agc): keep CMASK clears resident without host imports #1337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1337"
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 TibixDev on 2026-10-07T23:50:43Z.
What
Keep a uniform CMASK clear in the GPU image when guest memory cannot be imported. Copy the result back when the CPU needs it. Let storage-image creation errors propagate instead of continuing with a CPU fallback.
Narrowed after #1072 and #1447 merged. Their CMASK decoding, extent calculation, and expanded-CMASK handling on DCC targets are retained. Metadata reuse is separate.
Tested
Fedora 44 Release: graphics tests and contribution checks pass. RX 6600/RADV and lavapipe pass the focused clear, repeated-clear, copied write-back, and creation-failure tests with core and synchronization validation. Windows CI is pending.
Checklist
main; related CMASK PRs checked.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:26:21Z.
#1072 and #1237 already decode CMASK and materialize uniform clears, and both are still under review. Once they land, could you rebase and keep only what they lack, the reuse of validated CMASK metadata and the clear without host imports, as separate PRs?
Also, the new CMASK block in
DrawWithRecipe(Draw.cpp) catches the exception fromCachedStorageSurfaceand carries on without a resident image; please let it throw.Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:43:47Z.
Rebased on
6b573862and narrowed after #1072 and #1447 merged. This now keeps clears resident without host imports and propagates storage-image creation errors. The duplicated decoder and size calculation are removed. Metadata reuse is being checked separately.Fedora 44 Release graphics tests pass. RADV and lavapipe pass the focused repeated-clear, copied write-back, and failure tests with core and synchronization validation. Contribution checks pass; Windows CI is pending.
The removed metadata cache is preserved in a separate local experiment. It is not submitted: isolated 4/24/64 KiB tests show no reliable gain on Linux (both versions about 38–40 us per lookup; permission checks dominate). This PR keeps the verified resident-clear and error-propagation fixes.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:07Z.
Conflicts with main in
Draw.cpp(#1177 changed the tile-mode check next to your change) andtests/Recorder.cpp; please rebase.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:13:18Z.
Rebased onto current
main(conflicts inmetadataPassResidentafter #1177, kept main's tile-mode condition and dropped the try/catch as asked; and the--cube-only/--cmask-onlyentries intests/Recorder.cpp).Checked: build + ctest for libSceAgcDriver green (267/267).
agc_driver_recorder_tests --cmask-onlypasses with the change and fails without it ("CMASK storage creation failure was silently ignored"). Note that target is not registered in ctest (same as onmain), so CI doesn't run it; I ran it by hand. Merging once CI is green on the rebased head.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:04:20Z.
Rebased again onto current
main: the only conflict was intests/Recorder.cpp(the new--completion-labels-onlyentry next to--cmask-only); both are kept, no logic change.Checked: build + ctest for libSceAgcDriver green, and
agc_driver_recorder_tests --cmask-onlypasses. Merging once CI is green on the rebased head.Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:05:40Z.
Additional platform validation on standalone PR head
a259913d82e95c4954c77f06ac43f88c43f79fcf:Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja.
Release /
BUILD_TESTING=ON: built the selected test targets; 1 CTest cases, 0 failures, 0 CTest skips.Tests:
agc_driver_graphics.Reproduce after building the test targets:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_(graphics|recorder)$".Also ran
agc_driver_recorder_tests --cmask-only: passed the focused CMASK recorder regressions.Vulkan: native AMD RX 6900 XT, driver 32.0.21045.5002.
Integration limitation: a local merge against main
948a526c2has source conflicts; these results validate the standalone PR head, not a resolved merge.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T00:08:58Z.
Rebased onto current
main. Conflict only intests/Recorder.cpp(the--host-import-unmap-only/--unit-shadow-onlyentries next to--cmask-only); all are kept.GuestAllocations::Mutation::Addnow takes agpuflag onmain, so I added one commit passing it incmaskPassTests(true, true, true, like the rest of the file). No logic change.Checked: build + ctest for libSceAgcDriver green, and
agc_driver_recorder_tests --cmask-onlypasses. Also thanks to @Mouhand-Kaddo for the Windows run. Merging once CI is green on the rebased head.