feat(agc): render 5_6_5 UNORM color targets #7213
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7213"
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 thuanquang on 2026-10-17T16:59:43Z.
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(#5271, fixed by #6976) andagc_driver_layered_volume_vertex_no_gpl(#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
Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-17T17:15:30Z.
NVIDIA data point, since the description lists an RX 6700 XT: head
20502c002as-is, Release, Windows 10 Pro 22H2 (19045), WinLibs GCC 15.2.0 r7, NVIDIA GeForce RTX 3080 (617.42) chosen withANYPS5_GPU.agc_driver_color565_target: 5 of 5 pass (not skipped).agc_driver_graphics(withColor565TargetTests): 5 of 5 pass.Not checked: other tests, titles.
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T17:36:26Z.
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)core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL756Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T17:55:26Z.
First NVIDIA + first Intel runs, head
20502c002, Windows 11, MinGW (WinLibs GCC 15.2.0), Release, serial fresh processes:agc_driver_color565_target(tiled + linear, both component orders) andagc_driver_graphics(incl.Color565TargetTests) pass.ANYPS5_GPU=UHD, igvk64): both pass.Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-10-17T18:03:27Z.
@TheSovietWaffle
Can confirm main branch + PR #7213 has removed the blocker. Further testing required and will update discussion #6434