Skip to content

fix(agc): render CB_COLOR_CONTROL mode disable as a draw without color - #1414

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
TheAggie:fix/agc-color-control-disable
Oct 8, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
TheAggie:fix/agc-color-control-disable

Conversation

@TheAggie

@TheAggie TheAggie commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What

CB_COLOR_CONTROL.MODE 0 (disable) turns off color writes. It was accepted only when no color target was written. With a written target the draw was skipped (only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00000000, mode disable)), even though the hardware writes no color in that mode.

  • DecodeState: when the mode is disable, no export counts as written, so the draw has no color attachment and renders like the existing attachment-free path (depth only, or the screen scissor extent).
  • colorControlSupported: mode disable is accepted with any ROP3 and other bits, which do not apply while color writes are off. The draw rejection check accepts the same.
  • agc_driver_graphics (DisabledColorTests): a written color target with CB_COLOR_CONTROL 0x0 and 0xcc0000 decodes without a color attachment and keeps the scissor extent. It fails without the change.

Related to #1346, which drops COLOR_INVALID targets from the write mask. That PR handles disabled formats, this one the disabled mode; both touch the same check.

Tested

Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.

Not tested on AMD, Intel or Linux.

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

🤖 Generated with Claude Code

@TheAggie

TheAggie commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Showcase before/after on the combined local branch: without this change the instanced scene's draws are skipped; with it (together with #1415) the scene renders.
1414-1415-after-showcase-scene
1414-1415-before-showcase-no-scene

Mode 0 of CB_COLOR_CONTROL turns color writes off, but a draw with a
written color target and this mode was skipped as unsupported. Count no
export as written when the mode is disable, so the draw renders without
a color attachment like the existing attachment-free path, and accept
the mode with any ROP3, which does not apply while writes are off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked build + full ctest on current main + this PR (457/457, agc_driver_graphics passes), and the new DisabledColorTests case fails without the State.cpp change. Mode 0 = CB_DISABLE matches Mesa (V_028808_CB_DISABLE). The branch conflicted with main in State.cpp/tests/Graphics.cpp (#1419 colorControl &= ~1u, COLOR_INVALID test block); rebased keeping both. Merging once CI is green on the rebased head.

@adriadam10
adriadam10 force-pushed the fix/agc-color-control-disable branch from 1866fbc to 550920a Compare October 8, 2026 13:16
@adriadam10
adriadam10 merged commit 83c57cb into boykopovar:main Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants