Repository navigation
feat(agc): render 5_6_5 UNORM color targets - #7213
Conversation
Goosebumps Terror in Little Creek (PPSA27305) aborts in gameplay with "unsupported color format 16 number type 0 component swap 2": it renders into a COLOR_5_6_5 UNORM target. The target now renders into R5G6B5_UNORM_PACK16. AMD keeps X in bits 0-4 and Z in bits 11-15, and Mesa's ac_translate_colorswap programs SWAP_STD_REV for a surface with red in bits 11-15, so with SWAP_STD_REV the exports are written as they are and with SWAP_STD they are written with X and Z exchanged, as for 1_5_5_5. The alternate swaps and other number types keep throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
NVIDIA data point, since the description lists an RX 6700 XT: head
Not checked: other tests, titles. AI-assisted: yes (Claude Code). |
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
First NVIDIA + first Intel runs, head
|
|
@TheSovietWaffle |
What
Goosebumps Terror in Little Creek (PPSA27305) reaches gameplay and then aborts on its save tutorial popup with
AGC graphics: unsupported color format 16 number type 0 component swap 2(discussion #6434): it renders into aCOLOR_5_6_5UNORM color target, whichDecodeColorFormatrefused.The target now renders into
VK_FORMAT_R5G6B5_UNORM_PACK16, which Vulkan requires to support color attachments and blending. The AMD layout keeps X in bits 0-4, Y in 5-10 and Z in 11-15;COMP_SWAPpicks which export fills which field. Mesa'sac_translate_colorswap(mesa-26.2.2 ac_formats.c) programsSWAP_STD_REVforPIPE_FORMAT_B5G6R5_UNORM(channels[UN5, UN6, UN5]from the least significant bits with swizzle[Z, Y, X], so red in bits 11-15) andSWAP_STDforPIPE_FORMAT_R5G6B5_UNORM(red in bits 0-4). So:SWAP_STD_REV(2, the title's): red in bits 11-15, which is R5G6B5's red, so the exports are written as they are (mapping0xe4);SWAP_STD(0): red in bits 0-4, so the exports are written with X and Z exchanged (mapping0xc6), as the existing 1_5_5_5 target does.SWAP_ALT/SWAP_ALT_REVand the other number types keep throwing. Clears copy the raw clear words and the write mask and blend constants go through the component mapping as for the other formats, so nothing else is format specific. A technical debt entry records the source of the layout and what is not measured on a PS5.Destination alpha reads as 1, as Vulkan defines it for a format without alpha; that is not measured on the console.
Not covered, as for 1_5_5_5: R5G6B5 has no entry in the DCC and multisample clear-encoding tables, so a CB DCC decompress or eliminate of DCC clear codes other than 0000 and a fast clear of a multisampled 5_6_5 target still throw.
Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,ANYPS5_REQUIRE_VULKAN=1:agc_driver_graphics: newColor565TargetTestscheck the decoded format, component mapping and write mask for both orders, alpha blending, and that number types 1 and 4 and swaps 1 and 3 still throw.agc_driver_color565_target: draws 32_ABGR exports into a tiled and a linear 5_6_5 target in both component orders and compares every stored 16-bit texel with a literal expected value for each order (pure channels,k/31andk/63values in every field, clamped values, texels outside the scissor untouched); red is0xf800withSWAP_STD_REVand0x001fwithSWAP_STD.mainboth fail with the title's message:AGC graphics: unsupported color format 16 number type 0 component swap 2. With the two mappings exchanged,agc_driver_color565_targetfails:a 32_ABGR export of (1, 0, 0, 1) into a tiled 5_6_5 unorm target with the reversed component order: pixel (0, 0) inside the scissor holds 0x001f, expected 0xf800. With this change both pass, and so doagc_driver_color1555_target,agc_driver_packed_unorm_color_target,agc_driver_swap_alt_blendandtexture_format_lookup.ctest --parallel 4 --timeout 120onmain66702f1cfwith this change: 1401 tests; onlyagc_driver_lds_mixed_width_atomics(agc_* tests: 3 of 483 fail on AMD Radeon RX 6400, pass on NVIDIA RTX 4080 SUPER #5271, fixed by fix(shader): release the LDS lock with an exchange and drop fences inside it #6976) andagc_driver_layered_volume_vertex_no_gpl(AMD Windows: GPL-mode cache failures (alpha/wave32 pass after local driver update) #4768) fail, as onmainhere. After that run the two test files only changed to literal expected values and a stronger mapping check, and both pass again.python tools/check_conventions.py --base origin/mainwith this title and body passes.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 repository (attach them to this PR)🤖 Generated with Claude Code