feat(libSceAgcDriver): skip CMASK decode on single-sample views with viewMip > 0 #4965
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4965"
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 pushkarreddyy on 2026-10-13T06:41:33Z.
What
On AMD GFX10/GFX11 hardware, CMASK metadata only covers base mip level 0 (or MSAA samples). When a title sets up a mipmapped color target, CB_COLOR_INFO may retain
FAST_CLEAR(bit 13) while binding sub-resources (viewMip > 0), which drivers such as Mesaradeonsiexplicitly mask off (if (cb_psurf->level > 0) cb_surf.cb_color_info &= C_028C70_FAST_CLEAR;insi_state.c). In AnyPS5, bindingviewMip > 0withFAST_CLEARset causedDecodeColorBufferto fail withRequire(color.samples > 1 || (maxMip == 0 && !volume && slice == 0), "CMASK fast clears of a mipmapped, 3D or array color target are unsupported").This change skips single-sample CMASK fast-clear decoding when
viewMip > 0, leavingcmaskAddress = 0andcmaskFastClear = falseinstead of rejecting the draw.Tested
Added unit test in
core/libs/prx/libSceAgcDriver/tests/Graphics.cppverifying that a color buffer withFAST_CLEARset andviewMip == 1skips CMASK decoding withcmaskFastClear == falseandcmaskAddress == 0, whileviewMip == 0on a mipmapped target continues to reject unsupported fast clear. Verified documentation indocs/dev/debt/libSceAgcDriver.md.Checklist
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T08:40:09Z.
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main
534451426together with six other open GPU PRs (their own commits applied, no merge conflicts), so only the tests that belong to this PR say something about it:tests/Graphics.cpp(targetagc_driver_graphics_tests), run asagc_driver_graphics(10 of 10 passed; this test is known to fail sometimes on address layout, see #4660), and in the same targetagc_sparse_buffer_holes,agc_descriptor_pool_reset_failure,agc_compute_descriptor_layout_flags: 3 of 3 passed each.Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-13T12:22:40Z.
Rebased cleanly onto latest origin/main resolving the libSceAgcDriver.md merge conflict with newly merged #4041. Conventions checks pass locally with 0 findings and 0 errors, and Windows unit tests verified 10/10 clean by @xXPBSXx.
This unblocks Teardown (PPSA08182 / Issue #3701). Register state confirmed on hardware: single-sample view with iewMip = 1 where CMASK metadata only exists on base mip 0 (FAST_CLEAR skipped).
@adriadam10 @oneandonlydean @MarcZX100 Clean, mergeable, and ready for review/merge when convenient.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T14:00:52Z.
Evidence for the error this fixes: in three of my saved runs of PPSA15246 (2026-10-11, before this change) the title stops with
AGC graphics: CMASK fast clears of a mipmapped, 3D or array color target are unsupported, the message quoted in the description. The same title also logsruntime image descriptor is invalidin nine other saved runs, which may be a separate problem. I have not run PPSA15246 with this PR applied, so whether this change alone lets it continue is not tested.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-13T14:44:08Z.
@xXPBSXx Thanks for confirming the saved run evidence on PPSA15246! That matches the exact CMASK fast clear assertion this PR resolves.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:20:19Z.
Rebased onto main to resolve the conflict in
docs/dev/debt/libSceAgcDriver.mdafter #4603 and #4517; no other change.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T01:29:44Z.
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)docs/dev/debt/libSceAgcDriver.mdL76-77