fix(agc): raise a color-only single-sample scan with MSAA_ENABLE to the target's samples #27672
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27672"
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 DerKarussellbremser on 2026-11-26T22:33:19Z.
What
A draw with one multisampled color target, no depth target and a one-sample rasterizer (
PA_SC_AA_CONFIG) is raised to the target's sample count with every sample at the pixel centre (#4414). That was limited to draws withMSAA_ENABLEclear inPA_SC_MODE_CNTL_0. With the bit set the draw kept one sample andDecodeStatethrewa color target's sample count differs from the rasterizer's.The depth-only case already handles the same state: a one-sample rasterizer with
MSAA_ENABLEset scans into a multisampled depth target under the conditions ofsingleSampleDepthScanRejection(triangles and rectangles only, no Z interpolation or overrasterization inDB_EQAA, no pixel program reading the sample index, no sample-mask export). The color-only case now does the same under the same conditions. The check takes the target's name and is shared by both; the depth messages are unchanged.Both raises also repeat
sampleCoverageSupportedwith the raised sample count (review,c2c4e8b195). It ran only before the raise, at one sample, where it accepts every state, so a running pixel program readingSAMPLE_COVERAGEtogether with a sample-rate input passed through both raises. The depth raise had that order onmain.Assassin's Creed Black Flag Resynced (PPSA28183, 01.006.038) issues such a draw after its opening scene, before the Animus sequence: one color target with 4 samples at 640x360, no depth target,
PA_SC_AA_CONFIGwith one sample,PA_SC_MODE_CNTL_0= 0x3. The title stopped there.Tested
Windows 11 Home 10.0.26200, i7-10750H, 16 GB, NVIDIA GeForce RTX 2060 6 GB, driver 610.91, WinLibs GCC 15.2.0 r7 UCRT, Release, on
main00b15fcbb0.agc_driver_graphics_testshas amsaaColorOnlystate next to themsaaDepthOnlyones: one 4-sample color target, no depth, one-sample rasterizer,MSAA_ENABLEset. It checks that the state decodes to 4 samples with every sample location at (0.5, 0.5) and no draw rejection, and that the scan is still rejected for an off-centre sample, for primitives other than triangles and rectangles, for a pixel program reading the sample index, for a sample-mask export and for alpha-to-coverage.State.cppas onmainthe test fails witha color target's sample count differs from the rasterizer's, the title's message.MSAA_ENABLEset and clear and for the depth raise, and that a coverage input alone still decodes to 4 samples. Without the repeated check those cases fail withexpected graphics rejection: SAMPLE_COVERAGE in a multisampled pixel shader.ctest -R "^agc_driver_graphics": 5 of 5 pass atc2c4e8b195(agc_driver_graphics, the threeagc_driver_graphics_dump_*andagc_driver_graphics_pipeline_outside_gpu_mutex).tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branch fix/agc-color-scan-msaa-enable: 30 open PRs touchtests/Graphics.cpp, 10 of them alsoState.cpp. I read those ten diffs and the two thatgh pr diffdoes not return (#7642, #9508, compared from their fetched heads): none changessingleSampleDepthScanRejection, the color raise or the MSAA scan tests.a color target's sample count differs from the rasterizer's(about 1700 s into the run on this machine).c2c4e8b195), applied tomainf73d791b3dtogether with #27437, #27371, #27451, #27812 and #27872: one run of 3500 s passes the draw, shows the Animus sequence and reaches the map loading screen after about 57 minutes; neithera color target's sample count differsnor the repeatedSAMPLE_COVERAGErejection occurs.agc_driver_multisample_centered_lines(review,9a48678378, test only): the fixture, which loads every sample of a 4x target through a computeimage_load, gains a triangle list with a one-sample rasterizer andMSAA_ENABLEset. Every pixel has none or all four of its samples covered (63 in full, none in part) and the coverage equals the one-sample triangle's in all 256 pixels. Red on the base (State.cppas before this PR):a color target's sample count differs from the rasterizer's. With the validation layer loaded this test,agc_driver_graphicsandagc_driver_msaa_enable_single_samplepass, noVUID-line. It is skipped withoutshaderStorageImageMultisampleorVK_EXT_sample_locationsat 4 samples.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
https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T22:39:53Z.
Review: COMMENTED
Actionable comments posted: 1
fe3500fc-844d-4636-8bf0-686dd858d4cfReviewing files that changed from the base of the PR and between
acf3fee1e5and5c0c765077.core/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T23:00:52Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and focused regression coverage support the stated color-only scan behavior.
What I ran
Inspected head
5c0c76507778974e3c1f027a575109a2967c798ausingrepo_read.pyfor the prepared diff and targeted source. No commands or tests were run during this review; test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports Windows test, convention, and game runs; those were not independently verified. Linux, macOS, AMD, Intel, and physical-console behavior were not verified. The review bundle’s
manifest.jsonmarksGraphics.cppas not included because it was too large; the changed test lines were read from the pinned repository head. The bundle did not exposefiles.json, so its reviewed/excluded inventory could not be independently confirmed.State.cppwas read at the changed functions and their relevant surrounding logic; unrelated portions of that file were not read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T10:40:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The code changes and added test cases were reviewed at head
c2c4e8b1956b379306f4f7b538433f2a940d0674; no blocking defect was found, but checks could not be run in this session.What I ran
No commands were run. The review tools provided read access only.
Results
Negative control
Not run in this session. The description reports a red-on-base test; that result was not independently verified.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No checks were run. The author-reported test, convention-check, overlap-check, and game-run results were not independently verified. Files reviewed:
core/libs/prx/libSceAgcDriver/Graphics/src/State.cppandcore/libs/prx/libSceAgcDriver/tests/Graphics.cpp. No changed files were excluded from source review.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-29T17:56:19Z.
Review: APPROVED
Re-checked head
c2c4e8b195, which answers my comment and CodeRabbit's finding: the coverage check now runs again after the depth raise and after the color raise, with the raised sample count.Windows 11, WinLibs GCC 15.2, Release, merged onto
main6f6f6c8e6b, RTX 5080:agc_driver_graphicspasses, 3/3. It runs on MockVulkan, so no validation layer loads there. Without the two newrequireSampleCoveragecalls it fails at the new cases ("expected graphics rejection: SAMPLE_COVERAGE in a multisampled pixel shader").msaa_enable|single_sample|native_multisample_depth|msaa_color_onlypass on bothmainand the PR, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validation. The loader inserted the layer 17 times on each side, and neither log has aVUID-.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:02:27Z.
Review: COMMENTED
The register tests cover centered sample locations and reject unsafe inputs for the new color-only path. Could a render fixture draw an edge across a pixel and read back all four samples? The new decode state puts all samples at the center, but the decoding test would also pass if the pipeline later used default multisample locations or shuffled the coverage incorrectly.
Source review at
c2c4e8b195. The head trial-merges onto6ef4f2f73b. Focused Linux checks are queued.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T00:36:57Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional. The reviewed changes raise the color-only scan under the stated conditions and apply the existing depth-scan rejection rules.
What I ran
Reviewed head
9a486783783e34f80aa9ea7f6cd53dc3d83d2e6aagainst basemain; no merged-preview check. I usedrepo_read.pyto inspect the prepared diff and manifest, then relevant source ranges. No build or tests were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The reported build, test, and game runs were not independently run. Linux and macOS, AMD and Intel GPUs, and physical-console behavior were not verified. Read the changed ranges in
State.cpp,Graphics.cpp, andMultisampleCenteredLines.cpp;files.jsonlists no excluded files.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.