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

Merged
Celegans12 merged 1 commit from upstream-pr/1058 into main 2026-10-08 05:52:46 +00:00
Celegans12 commented 2026-10-07 06:24:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-07T06:24:14Z.


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.

  • DecodeColorFormat maps 8_SRGB (component swap 0) to R8_SRGB; other swaps and 8_8_SRGB still throw.
  • Unless R8_SRGB supports both COLOR_ATTACHMENT and COLOR_ATTACHMENT_BLEND, AttachmentProxyFormat picks RGBA8_SRGB (APS5_SRGB_ATTACHMENT_PROXY=1 forces it). The resident R8 image is blitted into an RGBA8 copy before the pass and back after it, and the pass writes R only through an RGBA8_SRGB view: encode, decode and blending are the device's, as for 8_8_8_8_SRGB.
  • Devices with R8_SRGB attachments render straight into an R8_SRGB view of the resident image, like other resident targets. Proxied draws leave no draw recipe.
  • Still throws on a proxy device: linear, mipmapped and 3D 8_SRGB targets; two TechnicalDebt lines.
  • PPSA26344 v1.008: the G-buffer pass (slot 5 of six 4K targets, first 0x5050bc0000) and a multiply-blend pass (0x503b270000) throw this.
  • #419 and #788 also edit Draw (#419 recordDraw too), #290 and #944 StorageTexture::release; all merge cleanly. Draft #426 does too, but already conflicts with main.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main 9ab937b2: 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4768820632 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1058). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-07T06:24:14Z. --- ### 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. - `DecodeColorFormat` maps 8_SRGB (component swap 0) to R8_SRGB; other swaps and 8_8_SRGB still throw. - Unless R8_SRGB supports both `COLOR_ATTACHMENT` and `COLOR_ATTACHMENT_BLEND`, `AttachmentProxyFormat` picks RGBA8_SRGB (`APS5_SRGB_ATTACHMENT_PROXY=1` forces it). The resident R8 image is blitted into an RGBA8 copy before the pass and back after it, and the pass writes R only through an RGBA8_SRGB view: encode, decode and blending are the device's, as for 8_8_8_8_SRGB. - Devices with R8_SRGB attachments render straight into an R8_SRGB view of the resident image, like other resident targets. Proxied draws leave no draw recipe. - **Still throws** on a proxy device: linear, mipmapped and 3D 8_SRGB targets; two TechnicalDebt lines. - PPSA26344 v1.008: the G-buffer pass (slot 5 of six 4K targets, first 0x5050bc0000) and a multiply-blend pass (0x503b270000) throw this. - #419 and #788 also edit `Draw` (#419 `recordDraw` too), #290 and #944 `StorageTexture::release`; all merge cleanly. Draft #426 does too, but already conflicts with `main`. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0, based on `main` 9ab937b2: 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 - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-07 09:42:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T09:42:30Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6035297344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1058#issuecomment-6035297344). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T09:42:30Z. --- <!-- pr-overlap --> 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](https://github.com/boykopovar/AnyPS5/blob/df16c4c256be3c44e03eb9149a6ce5f8e8a038b2/docs/dev/TechnicalDebt.md#L256) | | | | #1182 | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` [L8](https://github.com/boykopovar/AnyPS5/blob/df16c4c256be3c44e03eb9149a6ce5f8e8a038b2/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L8) | | | | #1190 | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` [L8](https://github.com/boykopovar/AnyPS5/blob/df16c4c256be3c44e03eb9149a6ce5f8e8a038b2/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L8) | | | | #1199 | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` [L8](https://github.com/boykopovar/AnyPS5/blob/df16c4c256be3c44e03eb9149a6ce5f8e8a038b2/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp#L8) | | |
adriadam10 commented 2026-10-08 05:52:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T05:52:42Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6053336795 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1058#issuecomment-6053336795). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T05:52:42Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1058
No description provided.