Repository navigation
fix(agc): rasterize a single-sample scan into a multisampled target at the pixel center - #4414
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Conversation
…t the pixel center With PA_SC_AA_CONFIG at one sample and MSAA_ENABLE off, the hardware scans each pixel once and gives every sample of a multisampled color target its result: radeonsi programs exactly this when GL multisampling is disabled on a multisampled framebuffer (si_emit_msaa_config leaves sc_aa_config 0), and GL defines it as single-sample rasterization with full coverage. Such a draw without depth or alpha-to-coverage now rasterizes the target's sample count with every sample location at the pixel center, which covers all samples exactly when the center is covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Windows test (MinGW, local build): PR head merged onto main c567576 without conflicts; AI-assisted (Claude Code). |
Contributor
11 tasks done
Merged
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
main9bc3623 at 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,
main9bc3623: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 fix(agc): accept MSAA_ENABLE on a single-sample target sampled at the pixel center #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*, Windows: VideoOut crashes intermittently when the Dozen (Vulkan on D3D12) driver is installed, even though the native driver is selected #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