Skip to content

fix(agc): compare a CB resolve's sample count with the rasterizer onl… - #6571

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
klosixgaming-arch:fix/agc-cb-resolve-msaa-disabled
Oct 19, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
klosixgaming-arch:fix/agc-cb-resolve-msaa-disabled

Conversation

@klosixgaming-arch

@klosixgaming-arch klosixgaming-arch commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Eternights (PPSA08270) stops right after its story intro, when a character takes a photo:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC graphics: CB resolve from a target whose sample count differs from the rasterizer's
FATAL: abort() (SIGABRT)

I captured the registers of that pass with a temporary diagnostic:

Register Value Meaning
PA_SC_AA_CONFIG 0x00108001 MSAA_NUM_SAMPLES 2x, MSAA_EXPOSED_SAMPLES 2x
PA_SC_MODE_CNTL_0 0x00000000 MSAA_ENABLE off
CB_COLOR0_ATTRIB 0x00012000 NUM_SAMPLES 4x (source)
CB_COLOR1_ATTRIB 0x00000000 single-sample (destination)
CB_COLOR0_INFO / CB_COLOR1_INFO 0x00040730 same format, 512×512

The title resolves a 4x target into a single-sample one with multisample rasterization disabled. PA_SC_AA_CONFIG still holds 2x from the draws before it. With MSAA_ENABLE clear, the scan converter rasterizes at the pixel centre and does not use PA_SC_AA_CONFIG's sample count, so the CB resolves CB0 at CB0's own NUM_SAMPLES. DecodeColorMetadataPass already takes the count from CB0 when PA_SC_AA_CONFIG is single-sample (the PPSA36082 case in the debt entry). Now it also does so when MSAA_ENABLE is off, and it compares the two counts only when multisample rasterization is on. With MSAA_ENABLE set, a mismatch still throws as before.

metadataPassTests covers the case: the existing "differs from the rasterizer's" queue with MSAA_ENABLE cleared decodes as a resolve with CB0's sample count. The CB resolve sample count debt entry records the title and register values.

Tested

  • Windows 11, WinLibs GCC 15.2.0, RTX 5090 (NVIDIA 617.42), Ryzen 9 9950X3D. PPSA08270 01.004.000 on main with only this change gets past the photo scene, where it stopped every time before, and keeps playing.
  • agc_driver_graphics_tests built on Windows with the change.

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: PPSA08270 PPSA08270 Eternights #6575
  • GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (the title run above; the decode change runs on the CPU)
  • AI-assisted: yes. Written with AI assistance and reviewed by me.

@github-actions

github-actions Bot commented Oct 15, 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
PR 6451 docs/dev/debt/libSceAgcDriver.md L138-139

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6146 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6563 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6588 docs/dev/debt/libSceAgcDriver.md
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6636 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6639 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6762 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6786 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6887 docs/dev/debt/libSceAgcDriver.md
PR 6941 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 6958 docs/dev/debt/libSceAgcDriver.md
PR 6965 docs/dev/debt/libSceAgcDriver.md
PR 6966 docs/dev/debt/libSceAgcDriver.md
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6973 docs/dev/debt/libSceAgcDriver.md
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7008 docs/dev/debt/libSceAgcDriver.md
PR 7085 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7154 docs/dev/debt/libSceAgcDriver.md
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7258 docs/dev/debt/libSceAgcDriver.md
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7390 docs/dev/debt/libSceAgcDriver.md
PR 7432 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7650 docs/dev/debt/libSceAgcDriver.md

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 16, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@klosixgaming-arch
klosixgaming-arch force-pushed the fix/agc-cb-resolve-msaa-disabled branch from f2141f8 to 8b34434 Compare October 16, 2026 21:43
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 16, 2026
@klosixgaming-arch
klosixgaming-arch force-pushed the fix/agc-cb-resolve-msaa-disabled branch from 8b34434 to 14d25f5 Compare October 17, 2026 16:08
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@Dextroid17

Copy link
Copy Markdown
Contributor

Native Linux run of this head (14d25f5e7), since the linux, windows and relinker jobs skipped here. Setup: GCC 16.2.1, Release, env -i, ctest, 3 runs per arm. The test is agc_driver_covered_centroid_state (--covered-centroid-state, which runs multisampleTests). The description says metadataPassTests, but the new check is in multisampleTests.

  • This head: passes 3 of 3.
  • State.cpp at merge base 66702f1cf, test kept: fails 3 of 3 with the description's Eternights message, CB resolve from a target whose sample count differs from the rasterizer's.
  • Merged onto main at c0a7468f6: merges cleanly and passes 3 of 3.

Not run: Windows or the game.

AI-assisted: yes

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@klosixgaming-arch
klosixgaming-arch force-pushed the fix/agc-cb-resolve-msaa-disabled branch from 14d25f5 to beb8839 Compare October 19, 2026 00:16
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 19, 2026
…y under MSAA_ENABLE

PPSA08270 (Eternights) stopped after its story intro with "AGC graphics:
CB resolve from a target whose sample count differs from the
rasterizer's". It resolves a 4x 512x512 target into a single-sample one
with PA_SC_MODE_CNTL_0.MSAA_ENABLE off while PA_SC_AA_CONFIG still holds
2x from earlier draws. Without MSAA_ENABLE the scan converter does not
use PA_SC_AA_CONFIG's sample count, so the resolve takes its sample
count from CB0 as it already does when PA_SC_AA_CONFIG is single-sample.
@klosixgaming-arch
klosixgaming-arch force-pushed the fix/agc-cb-resolve-msaa-disabled branch from beb8839 to 0d4cbd5 Compare October 19, 2026 03:10
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit 72aba1d into boykopovar:main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants