fix(agc): keep the texels of CMASK tiles with codes other than 0 and 15 #4041
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4041"
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 ee6aba54 on 2026-10-11T21:57:54Z.
What
A fast-clear materialization threw when a CMASK nibble held a code other than 0 (cleared) or 0xF (expanded). PPSA18391 (engine: Clickteam Fusion) fast clears a color target whose CMASK it never initialized, so some nibbles hold leftover values (seen: 1 and 10), and presentation failed on the first frame with
CMASK codes 1, 10 were recorded.A tile with such a code now keeps its texels like an expanded tile, on the CPU path and in the compute pass (
CmaskClear.comp). A cleared tile of a DCC target still throws, as do the other unsupported cases. The existing graphics and CMASK fast-clear tests expected the throw for an unknown code; they now check that such a tile keeps its contents and that a later full clear and eliminate still work.Keeping the texels treats a tile that is not marked as cleared as not cleared, so the driver never overwrites bytes the title wrote with a clear value it did not ask for. Throwing stops the title, and clearing such a tile would guess a meaning for the code. What the console does with these codes on a single-sample target is unverified on hardware; the TechnicalDebt entry for CMASK fast clears says so.
Tested
1c5e62878.agc_driver_graphics: a code-3 tile is left unchanged while its cleared neighbour gets the clear value.agc_driver_cmask_fast_clear: a code-3 tile stays as it was, and a later full clear and eliminate work. Both fail without the change.ctest: 995 tests pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by winstrex on 2026-10-12T20:58:24Z.
Another title this fixes: The Pathless (PPSA01825, 02.000.000), Windows, RTX 5070 Ti. Tested on
main682ef0c17+ this PR + #4491 (PlayGo; without it the title stops earlier).mainthe first present aborts withCMASK codes 1, 2, ..., 14 were recorded. Its two 3840x2160 single-sample display buffers setFAST_CLEAR(CB_COLOR_INFO 0xa828, no DCC, clear words 0), but theirCB_COLOR0_CMASKpoints into memory the title uses as a CPU heap. At the first draw it holds PNG data, with every nibble value 0 to 15, and nothing on the GPU side clears it first.APS5_DUMP_FRAMES) across three runs. It then stops on unrelated errors (storage image access to depth/stencil surface ... is not implemented, or a Wwise access violation).main, compared frame by frame.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T00:36:01Z.
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.mdL70-71docs/dev/debt/libSceAgcDriver.mdL69-70docs/dev/debt/libSceAgcDriver.mdL70Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:47:17Z.
Checked the diff, the two updated tests (
agc_driver_graphics,agc_driver_cmask_fast_clear: both pass with the change and fail without it) and the scoped libSceAgcDriver ctest; the CPU path andCmaskClear.compagree (a code other than 0 keeps its texels, a cleared tile of a DCC target still throws), and the TechnicalDebt entry is updated. Also confirmed by @winstrex on The Pathless (PPSA01825, Windows, RTX 5070 Ti). Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T13:00:02Z.
Additional Windows fixture coverage found an AMD GPL-off device loss, tracked in https://github.com/boykopovar/AnyPS5/issues/5150.
agc_driver_cmask_fast_clearfails on exact unmodified main0f2683cb7withAGC graphics: vkQueueSubmit recorder: Vulkan result -4, and the same failure returns after byte-exact candidate restoration/full rebuild. NVIDIA on/off and AMD on each pass 5/5 on the two recorded candidate/base pins.This is a distinct synthetic-fixture finding, not an attribution to #4041 or a title result. Full reproduction and controls are in the issue. AI-assisted: yes.