fix(agc): leave blending off for a color target with CB_COLOR_INFO.BLEND_BYPASS #4862

Merged
Tamalero merged 1 commit from upstream-pr/4862 into main 2026-10-14 01:33:40 +00:00
Tamalero commented 2026-10-13 00:29:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-13T00:29:09Z.


What

DecodeState throws blend bypass conflicts with enabled blending when CB_BLENDn_CONTROL enables blending for a target whose CB_COLORn_INFO has BLEND_BYPASS set. That is bit 16 in Mesa's src/amd/registers/gfx10.json.

The bit makes the color block skip the blender for that target. Mesa sets it "according to docs" for UINT/SINT and 8_24/24_8/X24_8_32_FLOAT targets, which the blender cannot process (src/amd/common/ac_descriptors.c, shared by radeonsi and RADV). So a set bit with blending enabled is a valid state, not a conflict: the target is written unblended.

Blending is now enabled only when it is requested and not bypassed.

Tested

Linux (CachyOS), GCC 16, RTX 4090, Release, on main 1c5e62878:

  • agc_driver_graphics: the new BlendBypassTests check that blending stays off for a bypassed target with blending enabled, and stays on for an identical target without the bit. With main's State.cpp the test fails with blend bypass conflicts with enabled blending; with the change it passes.
  • Guardians of the Galaxy (PPSA01748): the title issues these draws right after its loading screen. Without this change it stops there with the error above; with it, it reaches its first UI. That run also carries #757, #758 and the metadata pass PR.
  • tools/check_conventions.py --base origin/main: passes.

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: PPSA01748 (no bring-up discussion yet)
  • AI-assisted: yes

Tested and written by Claude (AI assistant) on a contributor's machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4836626946 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4862). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-13T00:29:09Z. --- ### What `DecodeState` throws `blend bypass conflicts with enabled blending` when `CB_BLENDn_CONTROL` enables blending for a target whose `CB_COLORn_INFO` has `BLEND_BYPASS` set. That is bit 16 in Mesa's `src/amd/registers/gfx10.json`. The bit makes the color block skip the blender for that target. Mesa sets it "according to docs" for UINT/SINT and 8_24/24_8/X24_8_32_FLOAT targets, which the blender cannot process (`src/amd/common/ac_descriptors.c`, shared by radeonsi and RADV). So a set bit with blending enabled is a valid state, not a conflict: the target is written unblended. Blending is now enabled only when it is requested and not bypassed. ### Tested Linux (CachyOS), GCC 16, RTX 4090, Release, on `main` 1c5e62878: - **`agc_driver_graphics`:** the new `BlendBypassTests` check that blending stays off for a bypassed target with blending enabled, and stays on for an identical target without the bit. With `main`'s `State.cpp` the test fails with `blend bypass conflicts with enabled blending`; with the change it passes. - **Guardians of the Galaxy (PPSA01748):** the title issues these draws right after its loading screen. Without this change it stops there with the error above; with it, it reaches its first UI. That run also carries #757, #758 and the metadata pass PR. - **`tools/check_conventions.py --base origin/main`:** passes. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: PPSA01748 (no bring-up discussion yet) - [x] AI-assisted: yes *Tested and written by Claude (AI assistant) on a contributor's machine.* 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kr4y4 commented 2026-10-13 03:08:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-13T03:08:20Z.


A Windows and Intel run, since the description covers Linux on an RTX 4090.

Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head baaad78e8 merged into main 495bf91a0, which passes 1023 of 1023 on both GPUs.

  • agc_driver_graphics passes on both GPUs with --repeat until-fail:3. The full suite (ctest --timeout 120 --parallel 4) passes 1023 of 1023 on both.
  • With State.cpp as on main, agc_driver_graphics fails on both GPUs with blend bypass conflicts with enabled blending, as in the description.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137319004 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4862#issuecomment-6137319004). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-13T03:08:20Z. --- A Windows and Intel run, since the description covers Linux on an RTX 4090. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head baaad78e8 merged into `main` 495bf91a0, which passes 1023 of 1023 on both GPUs. - `agc_driver_graphics` passes on both GPUs with `--repeat until-fail:3`. The full suite (`ctest --timeout 120 --parallel 4`) passes 1023 of 1023 on both. - With `State.cpp` as on `main`, `agc_driver_graphics` fails on both GPUs with `blend bypass conflicts with enabled blending`, as in the description. Written with AI assistance.
github-actions[bot] commented 2026-10-13 16:34:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T16:34:22Z.


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
#5200 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp L896-897, L900-917
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6150336648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4862#issuecomment-6150336648). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T16:34:22Z. --- <!-- 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 | |---|---|---|---| | #5200 | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` [L896-897](https://github.com/boykopovar/AnyPS5/blob/2e7ab67e8dc484013e0d55f93988875f9bf76567/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L896-L897), [L900-917](https://github.com/boykopovar/AnyPS5/blob/2e7ab67e8dc484013e0d55f93988875f9bf76567/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L900-L917) | | |
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!4862
No description provided.