fix(agc): take a CB resolve's sample count from its source target #2121
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2121"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T09:25:44Z.
What
Follow-up to #419, as discussed there.
DecodeColorMetadataPasscounted a draw withCB_COLOR_CONTROLin resolve mode as a CB resolve only whenPA_SC_AA_CONFIGhad a sample count, and required the source target to match it. A title that resolves with the rasterizer single-sample fell through to the normal draw path, which refuses it with "only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00cc0030, mode resolve)".A color target's own sample count is
CB_COLOR_ATTRIB.NUM_SAMPLES, separate from the rasterizer's. radeonsi itself writesPA_SC_AA_CONFIG= 0 for a multisampled framebuffer when rasterizer multisampling and line smoothing are off (si_emit_msaa_config).PPSA36082
Hades II resolves its 4x targets with no sample count in
PA_SC_AA_CONFIG. On mainf1451396with the fixes it needs to get that far plus #419, its resolve draws were skipped with the error above. With this change they go through as CB resolves. (It also needs a fix for its non-standard 4x sample positions to render correctly, which is a separate follow-up.)Tested
Linux (CachyOS), x86-64, GCC, 7800X3D / RTX 4090.
agc_driver_graphics(new checks):PA_SC_AA_CONFIGcleared still decodes as a resolve, with its 2 samples taken from CB0.build.ymlrun locally on this head, rebased on maind1fd9372(SPIRV tools on, test registration check, build, libs, ctest): 1002/1004.guest_kernel_fcntlfailed only because my script ran ctest with no terminal on stdin; it passes when run from a terminal.agc_driver_pixel_ldshung the GPU once (Xid 109). It is the intermittent hang I also see on other heads, doesn't touch CB resolves, and passed in the next run on the same machine.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:05:32Z.
Additional platform validation on standalone PR head
3dc5175ec0000311e11ac00f2b7fd26156b87d73:Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja.
Release /
BUILD_TESTING=ON: built the selected test targets; 1 CTest cases, 0 failures, 0 CTest skips.Tests:
agc_driver_graphics.Reproduce after building the test targets:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_(graphics|cb_resolve)$".Vulkan: native AMD RX 6900 XT, driver 32.0.21045.5002.
Integration limitation: a local merge against main
948a526c2has source conflicts; these results validate the standalone PR head, not a resolved merge.Imported from boykopovar/AnyPS5. Originally posted by KingDarkHN on 2026-10-12T13:59:47Z.
Confirmed needed: Fallen Legion (PPSA07645) issues a mode-3 CB resolve while
CB_AA_CONFIG(0x2f8) reports a single sample, soDecodeColorMetadataPassdoes not treat it as a resolve and the draw is rejected with:Taking the sample count from the resolve source target (this PR) unblocks it. Two further MSAA-guard findings are on #1189. Repro: run
app.elffrom a standard PPSA07645 layout.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T03:25:31Z.
Rebased onto main myself (one conflict, the debt line next to #4199's entry; both kept). Build and ctest pass on
d57f9cfb.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T03:40:38Z.
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.
main)core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL1105-1107core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL1109-1110