fix(agc): render 8_8_8_8 and 16_16_16_16 color targets with reversed component orders #1425
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1425"
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 gjonn on 2026-10-08T04:24:16Z.
What
A color target of format 8_8_8_8 with
CB_COLOR_INFO.COMP_SWAP2 or 3 was refused ("unsupported color format 10 number type 0 component swap 2"). For four components these swaps are the reversed orders: SWAP_STD_REV stores the export as A, B, G, R from the lowest bits, and SWAP_ALT_REV as A, R, G, B. A title renders thousands of draws per minute into such targets. The same orders on 16_16_16_16 targets (format 12) were refused too.DecodeColorFormatreturns RGBA8 (unorm, snorm or sRGB) for those targets, with component mapping 0x1b (STD_REV) or 0x93 (ALT_REV). The pixel shader's exports are permuted through the same mapping the one-component swaps already use: memory componentctakes export component(mapping >> 2c) & 3. #1349 uses the same encoding for the alternate order of 16-bit targets (0xc6).Tested
agc_driver_graphicspasses with a new case. An 8_8_8_8 unorm target with COMP_SWAP 2 and 3 decodes to RGBA8 with mapping 0x1b and 0x93,ExportMappingscarries the mapping, all four channels are written, and enabling blending on it is refused.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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:18:23Z.
Checked on Linux: build + ctest 457/457, and
agc_driver_graphicsfails without theState.cppchange. The mappings (0x1b = A,B,G,R and 0x93 = A,R,G,B from the lowest bits) matchac_translate_colorswapin Mesa. Blending into a reversed target throws and SWAP_ALT on 16_16_16_16 stays refused, so nothing wrong is silently accepted. CI is green; merging.Heads-up: #1349 and #1073 touch the same lines of
DecodeColorFormatand will need a rebase after this lands. Could you add the title ID of the game that hits these targets? Nobody has been able to reproduce that part here.