Repository navigation
feat(agc): render into CMASK fast-clear color targets - #1072
Conversation
|
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.
|
|
On the overlap with #419: both PRs decode
Whichever PR merges second keeps both: one New commit 44d855a: @ThisIsAkill reported on #419 that PPSA21567's DCC targets ( |
Draws into a color target with CB_COLOR_INFO FAST_CLEAR (bit 13) were rejected. The CMASK keeps one nibble per 8x8 tile: 0 means the tile is fast-cleared and reads as CB_COLOR_CLEAR_WORD, 0xF means expanded (the texels hold the color). The texture units and display scanout do not read it, so a title runs a fast-clear eliminate pass before sampling or flipping such a target. DecodeColorBuffer now takes the CMASK address (CB_COLOR0_CMASK and CB_COLOR0_CMASK_BASE_EXT) and the bytes one nibble per 8x8 tile spans. Before a draw renders into the target, and in a fast-clear eliminate pass, a CMASK whose nibbles are all 0 is materialized: the target is filled with the clear texel (FillClear on its resident image, else guest memory on the CPU) and the CMASK bytes are stored as expanded, through the same GPU-ordered store as the DCC "uncompressed" keys (0xFF either way). The result equals the draw followed by the eliminate pass. An all-expanded CMASK changes nothing; a mixed one throws, as do fast clears of DCC, mipmapped, 3D and array targets. PPSA14632 (LEGO Horizon Adventures) fast-clears its two 3840x2160 display buffers through CMASK, so its final composite draw was dropped on every frame and only black was presented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A color target with both DCC and CB_COLOR_INFO.FAST_CLEAR keeps its fast clear in the DCC keys and fills its CMASK with 0xF (expanded), as radv does (radv_get_cmask_fast_clear_value) and as PPSA21567 does (CB_COLOR_INFO 0x10042730, reported on boykopovar#419). Such targets now decode; their clear is materialized by the existing DCC path. A DCC target's CMASK that is not all expanded throws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked the CMASK decode (address, size, refusals), the eliminate pass (cleared / expanded / mixed CMASK, DCC under an expanded CMASK) and This overlaps #419 (both decode |
44d855a to
b5be685
Compare
|
|
What
Draws into a color target with
CB_COLOR_INFO.FAST_CLEAR(bit 13) are no longer rejected. The fast clear is modeled on its CMASK:DecodeColorBufferreads the CMASK address (CB_COLOR0_CMASK,CB_COLOR0_CMASK_BASE_EXT) and the bytes one nibble per 8x8 tile spans (ColorTarget::cmaskAddress,cmaskBytes).RunColorMetadataPass), a CMASK whose nibbles are all 0 (fast-cleared) is materialized. The whole target is filled with theCB_COLOR_CLEAR_WORDtexel:FillClearon its resident image, else guest memory on the CPU. The CMASK bytes are then stored as expanded (0xF nibbles). The final pixels are those of the draw followed by the eliminate pass.The CMASK reads and stores reuse the DCC key paths, because expanded nibbles and "uncompressed" keys are both 0xFF bytes.
CurrentDccKeyswaits for recorded work that writes the range (the title's fast-clear fill may still be pending on the GPU), andMarkDccUncompressedrecords the store into the open batch when the memory is imported. A TechnicalDebt line records what is not modeled. The CMASK layout is not decoded, which is why only uniform CMASKs are accepted.materializeCmaskClearruns after the resident lookup's try block, so a refused CMASK fails the draw instead of leaving the target non-resident with the clear skipped.Tested
Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT.
CB_COLOR_INFO 0xa024, CMASK right after the texels, clear words 0). Its final composite into the display buffer was dropped on every frame, so only black was presented (344 of 344 presents in a 150 s run). With this change, the PlayStation Studios logo and the intro render. A 200 s run has no CMASK refusals.cmaskTestsinagc_driver_graphicscover the decode (address, size, the DCC, mipmapped and missing-address refusals) and the eliminate pass: a cleared CMASK becomes clear texels with an expanded CMASK, an expanded one leaves the texels alone, and a mixed one throws without changing them.ctest: 386 of 386 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