fix(agc): accept ANCILLARY without PS_ITER_SAMPLE for a one-sample depth target without MSAA_ENABLE #9988
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9988"
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 frankea on 2026-10-23T02:53:15Z.
What
A one-sample depth target under a multisampled rasterizer with
PA_SC_MODE_CNTL_0.MSAA_ENABLEclear is drawn as a one-sample draw at the pixel center (debt entry "A one-sample target under a multisampled rasterizer without MSAA_ENABLE"). A pixel program that reads theANCILLARYinput threw on this path:a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported for points or lines and with alpha-to-coverage, a sample index or coverage input, ....ANCILLARYnow throws on this path only withPA_SC_MODE_CNTL_1.PS_ITER_SAMPLE.SAMPLE_COVERAGEstill throws, and so does everything else the rule refuses. The message now says "a sample index input under PS_ITER_SAMPLE, a coverage input".main, changed itsPS_ITER_SAMPLEhandling; this branch merges it.ANCILLARYthrows with a one-sample depth target only underPS_ITER_SAMPLE, and why the rest is accepted.GPU semantics, with sources:
PS_ITER_SAMPLE, #7729 draws the program once per pixel on this path, but the console runs one invocation per sample, and each would read its own sample index. That case still throws.Why: Gran Turismo 7 (PPSA01317) draws three draws of its main pass this way while loading the World Map. They have pixel programs 0x12804bd400, 0x1280441a00 and 0x1280393e00,
SPI_PS_INPUT_ENAandSPI_PS_INPUT_ADDR0x2b01 (PERSP_SAMPLE,POS_X_FLOAT,POS_Y_FLOAT,POS_W_FLOAT,ANCILLARY),PA_SC_MODE_CNTL_10,DB_SHADER_CONTROL0x60 andDB_EQAA0x00050000. The one-sample depth target is under a 4xPA_SC_AA_CONFIG.Tested
Refreshed onto
main0db47b263(headea2b648a0; no conflicts), RTX 4090 (NVIDIA 616.92, Windows 11): the 63 ctest entries of the focused set below pass 63/63, each test run three times, and 63/63 under the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V), with noVUID-line; its only messages aremain's threeUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings fromagc_driver_alpha_to_coverage.main0db47b263passes the union of the refreshed sets, 115/115, under the same layer settings with noVUID-line.Gran Turismo 7 (PPSA01317), on a local stack of
mainwith the open PRs it needs before this stop (#7243, #7256, #7550, #7978, #8564, #9020, #9335, #9068, #9700, #9721, #9743, #9806) and local diagnostics. One of them acceptsANCILLARYon this path whateverPS_ITER_SAMPLEis, and logs the draws it accepts.Without it, 2 of 5 runs stopped on this refusal before GT7 created any tessellation pipeline.
With it (run un-3), the three draws above are accepted, all with
PS_ITER_SAMPLEclear, so this rule accepts them too. The run went on to the next stop on the other route, the texture sampled with unnormalized coordinates.Windows 11 (build 26200), NVIDIA GeForce RTX 4090 (driver 616.92), MinGW GCC Release build with
BUILD_TESTING=ON, all on one machine.agc_driver_graphics, with and without a one-sample color target. A one-sample depth draw whose running pixel program readsANCILLARYwithoutPS_ITER_SAMPLEdecodes as a one-sample draw, and the draw precheck accepts it. So does GT7's input set, 0x2b01.SAMPLE_COVERAGEstill throws, andANCILLARYwithPS_ITER_SAMPLEstill throws (an existing case).agc_driver_graphics_testsand the MSAA, CMASK, FMASK and journal tests: alpha_to_coverage, cached_image_multisample_guard, cmask_fast_clear, color565_target, fmask_image_reads, image_msaa_address_on_plane, msaa_enable_single_sample, multisample_fill_host_only, multisample_readback, multisample_retirement, multisampled_pass_order, native_multisample_depth, pipeline_journal, pixel_sample_coverage, sample_mask_multisample, sample_multisample_target, staged_clear_sampled_read.90d02422eonmain2e0c9251d): 62/62 passed, each test run three times (ctest --repeat until-fail:3).maincontrol:main2e0c9251dwith only this PR'stests/Graphics.cpp.agc_driver_graphicsfails on the new case withmain's refusal.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0),ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1withctest -V, onmain2e0c9251d(62/62) and on this PR (62/62). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS, and neither has aVUID-line. Both have the same threeUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings, frommain'sagc_driver_alpha_to_coverage.tools/check_conventions.py --base origin/mainreports no errors; its one warning is the length of the existing debt entry this PR edits.36b599691),agc_driver_graphicsno longer checks that unimplemented one-sample depth states throw: thedepthRefusedmessage and itsexpectFailurecalls are gone (SAMPLE_COVERAGE,ANCILLARYunderPS_ITER_SAMPLE, a sample-mask export, alpha-to-coverage, points and lines, and fourDB_EQAAsettings). The positiveANCILLARYand 0x2b01 decode checks, thePS_ITER_SAMPLEandINTERPOLATE_COMP_Zchecks and the sample-count mismatch check stay.main379b1dca3(fc29c5a33, #9721's conflicting line kept with this PR's) and thenmain9c85790c9(head5c19aa5e4; #8121 changed the same debt sentence, and both changes are kept), RTX 4090: the 65 ctest entries of the focused set's 18 targets pass 65/65 on both heads, three times each, and 65/65 under the validation layer with noVUID-line; the only messages aremain's threeUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings fromagc_driver_alpha_to_coverage.main9c85790c9passes the union of the sets tested tonight, 109/109, under the same layer settings with noVUID-line.Checklist
main; no other open PR implements the same functions. #9721 and #8121, both now inmain, changed the sameRequire(itsDB_EQAAmask and message) and the one-sample color rule next to it.NotImplemented_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)main; this branch keeps both changes)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T04:12:40Z.
Review: APPROVED
Reviewed exact head
90d02422e2against current main. The code narrows the exception to the one-sample depth path:ANCILLARYis accepted only whenPS_ITER_SAMPLEis clear; sample coverage and per-sample ancillary remain rejected. The tests cover the no-depth/color variants and GT7's reported input mask, while retaining negative controls. The debt note marks the inferred sample-0 behavior as unmeasured on console.The PR explicitly records the same-line integration order with #9721, which is still open; the touched code is separate in purpose and the PR is mergeable. I reran the convention check against current main, the test-script registration check available at this exact head (171 scripts), and
git diff --check; all pass. I could not execute the Vulkan/guest test suite locally because this workspace has no configured AnyPS5 build or GPU test runtime. The author reports 62/62 focused tests repeated three times on Windows with validation enabled, and a negative control that fails on the old behavior. Hosted policy checks pass and product build jobs are skipped.No blocking issue found in the reviewed diff.