Skip to content

feat(agc): implement 8 srgb color targets through rgba8 srgb proxies - #1058

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/agc-r8-srgb-color-target
Oct 8, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/agc-r8-srgb-color-target

Conversation

@Celegans12

Copy link
Copy Markdown
Contributor

What

8_SRGB color targets throw unsupported color format 1 number type 6 component swap 0. Decoding them isn't enough: R8_SRGB attachments are optional in Vulkan, NVIDIA 610.62 and lavapipe have none, and with the decode alone both drop the writes.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main 9ab937b: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 380/380 tests pass (ctest --output-on-failure)
  • Same build on lavapipe (Mesa 26.2.4 llvmpipe, 8-wide subgroups, VK_DRIVER_FILES): 379/379 pass; agc_driver_flat_store is left out there because it takes several minutes on Windows llvmpipe
  • New agc_driver_srgb8_color_target: multiply and DST_ALPHA blends (two in a continued pass), fast clear and MRT within 1 sRGB code; ZERO/ONE and outside-scissor bytes exact; fails on main.
  • agc_driver_graphics: decode, refusals, proxy choice; won't build on main.
  • PPSA26344 v1.008 (with the cache budget change): no color format 1 number type 6 skips, 3,355 before; 0 of 7 frame dumps from 250 to 480 s black, 9 of 10 before.
  • Not tested: R8_SRGB attachments, Linux (CI), the console.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

CB_COLOR_INFO format 1 with number type 6 (8_SRGB) threw at decode.
It now decodes as R8_SRGB with component swap 0; the other swaps and
8_8_SRGB still throw.

A device that cannot attach and blend R8_SRGB (NVIDIA, lavapipe)
renders a resident 8_SRGB target through an RGBA8_SRGB view of an
RGBA8 copy of its R8 image: the image is blitted in before the pass
and back when the pass ends, and the write mask keeps R only, so the
encode, decode and blend are the device's sRGB attachment rules.
APS5_SRGB_ATTACHMENT_PROXY=1 forces the copy. Linear, mipmapped and
3D 8_SRGB targets throw on such a device.

PPSA26344 renders its G-buffer slot 5 and a multiply-blend pass into
8_SRGB targets.
@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 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
#1122 docs/dev/TechnicalDebt.md L256
#1182 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L8
#1190 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L8
#1199 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L8

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on RADV (direct R8_SRGB path and the forced RGBA8_SRGB proxy via APS5_SRGB_ATTACHMENT_PROXY=1): agc_driver_graphics and agc_driver_srgb8_color_target pass, full ctest 416/416 on top of current main; the new tests don't build or fail without the change; Linux/Windows CI green. Remaining 8_SRGB cases still throw and are listed in TechnicalDebt; merging.

@adriadam10
adriadam10 merged commit 058dead into boykopovar:main Oct 8, 2026
3 checks passed
@Celegans12
Celegans12 deleted the feat/agc-r8-srgb-color-target branch October 8, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants