Skip to content

feat(agc): render 5_6_5 UNORM color targets - #7213

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
thuanquang:feat/color-565-target
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
thuanquang:feat/color-565-target

Conversation

@thuanquang

Copy link
Copy Markdown
Contributor

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 a COLOR_5_6_5 UNORM color target, which DecodeColorFormat refused.

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_SWAP picks which export fills which field. Mesa's ac_translate_colorswap (mesa-26.2.2 ac_formats.c) programs SWAP_STD_REV for PIPE_FORMAT_B5G6R5_UNORM (channels [UN5, UN6, UN5] from the least significant bits with swizzle [Z, Y, X], so red in bits 11-15) and SWAP_STD for PIPE_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 (mapping 0xe4);
  • SWAP_STD (0): red in bits 0-4, so the exports are written with X and Z exchanged (mapping 0xc6), as the existing 1_5_5_5 target does.

SWAP_ALT/SWAP_ALT_REV and 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: new Color565TargetTests check 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.
  • New 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/31 and k/63 values in every field, clamped values, texels outside the scissor untouched); red is 0xf800 with SWAP_STD_REV and 0x001f with SWAP_STD.
  • On main both 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_target fails: 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 do agc_driver_color1555_target, agc_driver_packed_unorm_color_target, agc_driver_swap_alt_blend and texture_format_lookup.
  • Full ctest --parallel 4 --timeout 120 on main 66702f1cf with this change: 1401 tests; only agc_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) and agc_driver_layered_volume_vertex_no_gpl (AMD Windows: GPL-mode cache failures (alpha/wave32 pass after local driver update) #4768) fail, as on main here. 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/main with this title and body passes.
  • Not tested: the title itself (I don't have it; @XatiX could rerun), the export direction on a PS5, other GPUs and drivers.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: Goosebumps Terror in Little Creek (PPSA27305), discussion Goosebumps Terror in Little Creek (PPSA27305) #6434
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, Windows 11 26200
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

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>
@TheSovietWaffle

Copy link
Copy Markdown
Contributor

NVIDIA data point, since the description lists an RX 6700 XT: head 20502c002 as-is, Release, Windows 10 Pro 22H2 (19045), WinLibs GCC 15.2.0 r7, NVIDIA GeForce RTX 3080 (617.42) chosen with ANYPS5_GPU.

  • agc_driver_color565_target: 5 of 5 pass (not skipped).
  • agc_driver_graphics (with Color565TargetTests): 5 of 5 pass.

Not checked: other tests, titles.

AI-assisted: yes (Claude Code).

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7207 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp L756

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5958 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6297 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6563 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@akkadbakkad89

Copy link
Copy Markdown
Contributor

First NVIDIA + first Intel runs, head 20502c002, Windows 11, MinGW (WinLibs GCC 15.2.0), Release, serial fresh processes:

  • NVIDIA RTX 3070 (driver 617.42): agc_driver_color565_target (tiled + linear, both component orders) and agc_driver_graphics (incl. Color565TargetTests) pass.
  • Intel UHD 630 (ANYPS5_GPU=UHD, igvk64): both pass.

@XatiX

XatiX commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

@TheSovietWaffle
Can confirm main branch + PR #7213 has removed the blocker. Further testing required and will update discussion #6434

@oneandonlydean
oneandonlydean merged commit c3c3dcf into boykopovar:main Oct 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants