Repository navigation
fix(agc): rasterize a multisampled target without MSAA_ENABLE at the pixel center - #5882
Conversation
|
Real-title check. METAL GEAR SOLID: Peace Walker (PPSA18216), Linux, RTX 3080 Ti (NVIDIA 615.71.09), AI-assisted; the runs are from my machine. |
|
MGS Peace Walker (PPSA18216, #5268) reaches this refusal with a depth target bound. On |
|
@mrfelek @SandstromPL Thanks for the Peace Walker data. I'd keep this PR to the case it was checked on, filled primitives with no depth target and no alpha-to-coverage, and take the depth target in a follow-up after it merges. #5915 already centres the depth samples for the single-sample-rasterizer case, so the depth handling belongs with that work. @SandstromPL, please go ahead with the follow-up. AI-assisted (Claude Code). |
|
One thing for this PR on current |
…pixel center A draw with PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES > 0 and PA_SC_MODE_CNTL_0.MSAA_ENABLE clear threw. On GFX10 and later the bit is what makes the rasterizer use the programmed sample locations; with it clear the draw now keeps the target's sample count with every sample at the pixel center. Points, lines, a depth target and alpha-to-coverage still throw. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…MSAA_ENABLE Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
d9d8fb7 to
e10ec39
Compare
|
@SandstromPL Thanks, good catch. Done in AI-assisted (Claude Code). |
|
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.
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.
|
|
Checked on the merged tree: |
…get under a 2x scan without MSAA_ENABLE boykopovar#5882 lets a multisampled scan without MSAA_ENABLE through the earlier check, so the draw is now refused where its one-sample color target meets the rasterizer's sample count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NABLE is clear On top of boykopovar#5882, a draw with PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES 2 (4x), MSAA_ENABLE clear, a one-sample color target and no depth target threw "a color target's sample count differs from the rasterizer's", which stops METAL GEAR SOLID: Peace Walker (PPSA18216) at its first presentation (draw C on boykopovar#5268). Without MSAA_ENABLE every sample is at the pixel center, and a one-sample target keeps the coverage of sample 0, so the draw is now drawn as a one-sample draw. PS_ITER_SAMPLE, ANCILLARY or SAMPLE_COVERAGE pixel inputs and a sample-mask export throw on this path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Requested by billy
What
Before: a draw whose
PA_SC_AA_CONFIG.MSAA_NUM_SAMPLESis above 0 whilePA_SC_MODE_CNTL_0.MSAA_ENABLEis clear threw "multisampled targets rasterized without MSAA_ENABLE are unsupported". SONIC SUPERSTARS (PPSA06888) stops on such a draw: a 2x color target, no depth target, no alpha-to-coverage,PA_SC_AA_CONFIG0x00108001,PA_SC_MODE_CNTL_00, nonstandard sample locations (0xc44c).After: such a draw keeps the target's sample count and puts every sample at the pixel center, the representation #4414 already uses for a single-sample scan into a multisampled target. Points, lines, a depth target and alpha-to-coverage still throw.
Where the semantics come from (not measured on hardware; the hardware oracle runs compute kernels only):
MSAA_ENABLEis what makes the rasterizer use the programmed sample locations: RADV 061bc615 sets it for 1x user sample locations because they have no effect without it. TheMSAA_ENABLE on a single-sample targetdebt entry relies on the same commit.MSAA_ENABLEfrom the GL multisample state (si_state.c, mesa-25.2.0). With multisampling disabled, GL rasterizes at the pixel center and gives the fragment full coverage, so every sample gets the pixel's value.The debt entry in
docs/dev/debt/libSceAgcDriver.mdrecords that the result withMSAA_NUM_SAMPLESabove 0 is inferred.How
DecodeStateused to refuse the combination after decoding the depth target and alpha-to-coverage state. It now accepts it for filled primitives without either, and setscustomSampleLocationswith every location at the center. That is the same pathSampleLocationsalready serves for #4414. TheGraphics.cppcase that expected the refusal now checks the sample count and the centered locations, and that alpha-to-coverage still throws.Tested
Windows 11, MinGW-w64 GCC 15, Release.
agc_driver_graphicsandagc_driver_msaa_enable_single_samplepass, andtools/check_conventions.py --base origin/mainpasses. SONIC SUPERSTARS (PPSA06888), on main with #5865, #5375 and #5456 merged locally, gets past this stop and reaches the next one: a shader reading a multisampled image. I did not compare the picture with a console. Not tested: Linux, other GPU vendors.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code