fix(agc): rasterize a single-sample scan into a multisampled target at the pixel center #4414
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4414"
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 reyani-dev on 2026-10-12T10:06:54Z.
What
A draw whose rasterizer is single-sample (
PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES= 0) withMSAA_ENABLEoff, into a multisampled color target, throwsa color target's sample count differs from the rasterizer's.The hardware supports this combination. radeonsi programs exactly this when GL multisampling is disabled on a multisampled framebuffer: in
si_emit_msaa_config(si_state.c, mesa-25.2.0),sc_aa_configstays 0 unlessrs->multisample_enable, andMSAA_ENABLEfollowsstate->multisample, whileCB_COLORi_ATTRIBkeeps the framebuffer's samples. GL defines the result: withMULTISAMPLEdisabled, rasterization is single-sample at the fragment center "except that the fragment coverage value is set to full coverage", so every sample gets the pixel's color.Such a draw now rasterizes the color target's sample count with every sample location at the pixel center (the custom sample locations from #2169), so all samples are covered exactly when the center is. It applies only with no depth target, no alpha-to-coverage and
MSAA_ENABLEoff, and only when the first written color target is multisampled. Any other mix still throws, andMSAA_ENABLEon keeps #4309's checks.Title: ProsperoPuzzles (PPSA99006) stops here on
main9bc362351at its first draw into its 4x target:Register values at that draw (posted on #419):
CB_COLOR0_ATTRIB0x00012000(4 samples, 4 fragments),PA_SC_AA_CONFIG0x00000000,PA_SC_MODE_CNTL_00x00000022(MSAA_ENABLEoff), no depth. The title renders through blackbearreloaded/ps5-opengl (Mesa gallium on AGC), the same driver family as radeonsi. With this change it gets past that draw and stops at the next one, which samples that 4x image:DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape(#3036).Tested
Windows 11 (26200), RTX 4070, WinLibs GCC 15.2.0 r7, Release,
main9bc362351:agc_driver_graphics(multisampleTests): AA config 0,MSAA_ENABLEoff and a 4x/4f target decode as 4 samples withcustomSampleLocationsand all four locations at (0.5, 0.5). WithMSAA_ENABLEon, the same draw is still refused (by #4309's check). This fails with main'sState.cppand passes with this change.ctest -E "^agc_|video_out|^shader|recompiler": 497/497. GPU suite (VK_LOADER_DRIVERS_DISABLE=*dzn*, #3255): 441/441.tools/check_conventions.pyandtools/pr_overlap.py: clean.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:40:26Z.
Windows test (MinGW, local build): PR head merged onto main
c5675762awithout conflicts;agc_driver_graphics(ctest) passes, including the new test from this PR. Not tested: no game run, no other test suites.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:40:41Z.
Correction to my test comment: the base I actually built and tested was main
0ef9dc928, notc5675762a(my local upstream/main ref had moved). Result unchanged: clean merge,agc_driver_graphicspasses.AI-assisted (Claude Code).