feat(agc-driver): render to COLOR_8_8 targets with SWAP_ALT #2916

Merged
XairRrR merged 1 commit from upstream-pr/2916 into main 2026-10-10 23:30:21 +00:00
XairRrR commented 2026-10-10 18:27:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-10T18:27:28Z.


What

PPSA05684 stops in its first level with unsupported color format 3 number type 0 component swap 1.

CB_COLOR_INFO.COMP_SWAP 1 (SWAP_ALT) on a two-channel format stores the x and w exports in its two channels (Mesa si_translate_colorswap, V_028C70_SWAP_ALT for 2 channels: "X__Y"). COLOR_8_8 UNORM and SNORM targets with it bind as R8G8 with export mapping 0xec. Blending into them still throws, since Vulkan would apply alpha factors to the wrong channel.

Test in tests/Graphics.cpp (ReversedComponentOrderTests).

Tested

  • Arch Linux (kernel 7.2.6), GCC 16.2.1, NVIDIA RTX 4070 Ti SUPER (driver 615.71.09), Release with BUILD_TESTING=ON.
  • Branch built alone; full ctest on main 57f96fd2: 697/698; the one failure, agc_driver_dcc_keys_first_write, fails the same way on plain main 57f96fd2. Conventions check passed.
  • Title: Uncharted: Legacy of Thieves Collection (PPSA05684), on its own bring-up branch.

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:4813482752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2916). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-10T18:27:28Z. --- ### What PPSA05684 stops in its first level with `unsupported color format 3 number type 0 component swap 1`. `CB_COLOR_INFO.COMP_SWAP` 1 (SWAP_ALT) on a two-channel format stores the x and w exports in its two channels (Mesa `si_translate_colorswap`, `V_028C70_SWAP_ALT` for 2 channels: "X__Y"). `COLOR_8_8` UNORM and SNORM targets with it bind as R8G8 with export mapping `0xec`. Blending into them still throws, since Vulkan would apply alpha factors to the wrong channel. Test in `tests/Graphics.cpp` (`ReversedComponentOrderTests`). ### Tested - Arch Linux (kernel 7.2.6), GCC 16.2.1, NVIDIA RTX 4070 Ti SUPER (driver 615.71.09), Release with `BUILD_TESTING=ON`. - Branch built alone; full ctest on main 57f96fd2: 697/698; the one failure, `agc_driver_dcc_keys_first_write`, fails the same way on plain main 57f96fd2. Conventions check passed. - Title: Uncharted: Legacy of Thieves Collection (PPSA05684), on its own bring-up branch. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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
adriadam10 commented 2026-10-10 23:30:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T23:30:18Z.


Checked: agc_driver_graphics passes on the PR merged onto main, and fails without the State.cpp change. The 8_8 SWAP_ALT mapping (x,w → R,G) matches fpPS4's two-channel table, and blending into it still throws; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103330589 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2916#issuecomment-6103330589). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T23:30:18Z. --- Checked: `agc_driver_graphics` passes on the PR merged onto main, and fails without the State.cpp change. The 8_8 SWAP_ALT mapping (x,w → R,G) matches fpPS4's two-channel table, and blending into it still throws; 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!2916
No description provided.