fix(agc): handle FMASK decompress on MSAA targets #4767
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4767"
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 Swastik-51 on 2026-10-12T21:16:50Z.
What
Fixes #4685. Recognize AGC
CB_COLOR_CONTROLMode 5 (FMASK decompress) for multisampled color targets.Tested
git diff --check— passed.python tools/check_conventions.py --base upstream/main— passed locally.3548a7e34:conventions: passed (success).eligibility: passed (success).report: passed (success).linux,windows,write-watch,relinker,register-context) were skipped (full PR runs require manual collaborator dispatch).dabcf4056, before the rebase and DCC follow-up commit. Those prior results are not presented as tests of the current head (3548a7e34).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 repositoryImported from boykopovar/AnyPS5. Originally posted by Swastik-51 on 2026-10-12T21:39:40Z.
Hello maintainers,
Could you please trigger the Linux/Windows CI build and run the regression tests (
fmaskDecompressMsaaTestsinRecorder.cppandmultisampleTestsinGraphics.cpp) for these AGC graphics changes when convenient? Local testing was limited to conventions and whitespace checks due to the absence of the required build toolchain in my local environment.Thank you!
Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T21:47:56Z.
First build and hardware run, since the description says the change wasn't compiled or run.
Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head 00d5ed1a6 merged into
main584cc4c57, which passes 1018 of 1018 on both GPUs.It builds. Two tests fail on both GPUs in every run (with
--repeat until-fail:3and in the full suite), and the other 1016 pass:agc_driver_graphics:unexpected failure: AGC graphics: missing register in context bank at DWORD 0x31f (799).multisampleTests. ItsCB_COLOR0_INFO(0x1002e028) has the fast-clear bit (13) set, soDecodeColorBufferreadsCB_COLOR0_CMASK(0x31f), which that queue doesn't set.FMASK decompress of a target without a CMASK addresscheck, andexpectFailuresees a different message.CMASK fast clears without a CMASK address are unsupportedcheck would fire first, also before the new one.agc_multisample_guest_access, the new case inRecorder.cpp:FMASK decompress did not materialize the seeded clear to the host multisampled image.Separately, the change removes the
DCC over a multisampled color target is unsupportedcheck fromDecodeColorBuffer. So DCC on a multisampled target is now accepted on every path, not only by the FMASK decompress pass.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:43:32Z.
Has this been built and run? kr4y4's run of 00d5ed1a6 had
agc_driver_graphicsandagc_multisample_guest_accessfailing on both GPUs, and dabcf4056 came after it with no result. Two things before this can go in:DecodeColorBufferinState.cpploses theDCC over a multisampled color target is unsupportedcheck on every path, not only for the FMASK decompress pass. Keep it for the other paths, or record indocs/dev/debt/libSceAgcDriver.mdwhat DCC on a multisampled target does now.A run of PPSA68091 past the stop in #4685 would settle the rest.
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-13T03:08:46Z.
Built and ran the current head
dabcf4056e3d214cad630a5b348de769382b677fon Linux. Both requested tests pass on all three devices:agc_multisample_guest_accessinvokesagc_driver_recorder_tests --multisample-only; every device log includesFMASK decompress MSAA clear and resolve tests passed. The Vulkan ICD was restricted to the intended device for each run, withANYPS5_REQUIRE_VULKAN=1and shader cache disabled. No ctest skipped. Both tests finished below 3 seconds per device.agc_driver_graphicsdoes report its existing guest-arena/write-watch-dependent heap-mirror subchecks as not tested.Ubuntu 24.04, Linux 7.0, GCC 13.3, Release, Ninja,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON, bundled dependencies. XRandR development files were unpacked into an isolated prefix for this build; no system package was installed. Production source and tests were unchanged, and the worktree is clean. This tests the exact PR head rather than a merge onto newer main.This resolves the missing current-head build/test evidence on these Linux devices. It does not resolve the maintainer's separate concern about accepting MSAA DCC outside the decompress path. PPSA68091 was not launched, no hardware metadata semantics were measured, and the full suite was not run.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T08:15:22Z.
AMD coverage, since the GPU tests in CI run only on lavapipe: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Head
3548a7e34merged ontomain9ba9ac1c8.ctest -R '^agc_' -j 1, test shader cache emptied: 460/460, the same asmainon this machine.--windows-fixed-base 0x400000: runs the full 60 s with and without this PR, at about 43 FPS. An unattended run doesn't start the Flash player, so it never reaches the FMASK decompress from #4685. This only shows the change causes no regression on that path; it doesn't confirm the fix on hardware.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Swastik-51 on 2026-10-13T19:38:06Z.
Thanks for the review feedback. I've updated the implementation to preserve the DCC-over-MSAA rejection outside the explicit FMASK-decompress path, added coverage for missing CMASK handling and clear materialization, and verified that the conventions checks pass on the current head (
02b40581a00f1eb5aa63c74d738d4e8417ab77b5).The full Linux and Windows CI jobs are currently skipped for PRs unless a collaborator dispatches the Build workflow. Could someone with the required permissions please trigger the full Build workflow for PR #4767 so the current head can be validated?
I haven't been able to run the native C++/Vulkan tests locally due to the missing build toolchain and Vulkan runtime. Thanks!
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T22:05:08Z.
Validation of the current head
02b40581aon AMD, following up on my earlier run of3548a7e34. Setup: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, full build. The PR is merged ontomain665ad7da7without conflicts.ctest -R '^agc_' -j 1, test shader cache emptied: 481 pass, 2 skip, 1 fails. The failure isagc_driver_layered_volume_vertex_no_gpl, which fails onmainon this driver too (GPL-off pipelines, #4768).agc_driver_graphicsandagc_multisample_guest_accesspass.fmaskDecompressMsaaTestsrun only throughagc_driver_recorder_tests --multisample-only, which is whatagc_multisample_guest_accessexecutes. Run directly 5 times, it exits 0 every time and ends withFMASK decompress MSAA clear and resolve tests passed.agc_driver_recorder_testsstops early on this machine ata signaled batch's read still refuses. Plainmainstops at the same check, so this PR does not cause it. That run is not registered in CTest; #5211 proposes registering it.Not checked: Ruffle's Flash player path. An unattended run doesn't open it, so it never reaches the FMASK decompress from #4685.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-14T16:32:13Z.
@Swastik-51 Update after #4767 merged first: #5939 head347d11b93 is rebased onto main8f51 and tested with merged #4767/#4820. The earlier merge-order suggestion below is superseded.
Full Windows app/libs/checkers pass. Sixteen groups pass once+5 under NVIDIA/AMD selectors; eight runtime groups, including DCC2/4/8 and native MSAA sampling, verify both actual devices. The two legacy recorder groups select NVIDIA in both Windows runs, so those results are NVIDIA-only. Linux lavapipe builds four executables and five supported groups pass once+5; unsupported2/8 explicitly skip. Main's FMASK clear/reuse fixture executes and passes.
The DCC fixture now materializes supported CMASK cases through Mode5 before drawing and checks that a later Mode5 pass preserves drawn samples despite changed clear registers. FMASK decode retains DCC control so unsupported flags are refused by the importer. #5336 holds unchanged-main state/pixel failure controls, geometry225×5 and original-title evidence with its older pins. This is synthetic merged-path validation, not a fresh title replay.
Earlier coordination request, superseded
@Swastik-51 I opened #5939 for uniform initial DCC fast clears in normal rendering. It builds independently on main e34, with NVIDIA/AMD and lavapipe supported-case regressions; #5336 has the title stop and scoped replay. The shared overlap is DecodeColorBuffer's multisample-DCC validation, while Mode5 FMASK decompression remains your topic. I suggest merging the normal-render support first, then rebasing #4767 onto it. Please let me know if you prefer the other order; I can retest the resulting composition. No claim that the two current heads have been composed/tested together.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:11:25Z.
Checked on the PR merged onto main: the scoped build and the
libSceAgcDriverctest (550/551; the one failure isagc_driver_tessellation, a RADV segfault that also shows on unrelated PRs), includingagc_driver_graphicsandagc_multisample_guest_access. The new tests don't compile without the change, and the Recorder case tells a materialized clear from a re-clear. The DCC-over-MSAA rejection is back on every path except the FMASK decompress pass, as @oneandonlydean asked, and kr4y4's two failures are gone (also covered by simonbbby on NVIDIA/RADV/llvmpipe and LeandroLP23 on AMD).Added as our own commit on your branch: the
Multisampled targets in CB passesline indocs/dev/debt/libSceAgcDriver.mdsaid a DCC pass over a multisampled target throws and only a resolve is modeled; it now describes the FMASK decompress (CMASK fast clear materialized only, DCC/FMASK contents not interpreted).Not verified: Ruffle's Flash player path from #4685; merging once the full Build is green.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:58:37Z.
Rebased onto current main: the only conflict was adjacency in
MultisampleTarget.hpp/.cpp(MultisampleTargetTexturelanded next toMaterializeMultisampleTargetClear); both kept, no logic change. Scoped build andlibSceAgcDriverctest on the rebased tree: everything passes exceptagc_driver_tessellation, a RADV segfault that also fails on main. Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:02:19Z.
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/Graphics/include/State.hppL144Imported from boykopovar/AnyPS5. Originally posted by Swastik-51 on 2026-10-14T18:12:35Z.
Thanks again for rebasing the PR and adding the debt documentation commit!
I checked the latest Build workflow run for head
a15f16324. The conventions check passed, but the Linux and Windows jobs were skipped because the workflow requires a collaborator-triggeredworkflow_dispatchfor full builds.Could you please trigger the Build workflow for PR
4767frommain, with the inputpr=4767?Once the full build completes, we can review the results and proceed accordingly. Thanks!