fix(agc): accept DB_EQAA INTERPOLATE_COMP_Z for a one-sample depth target without MSAA_ENABLE #9721
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9721"
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-22T09:54:39Z.
What
A one-sample depth target under a multisampled rasterizer with
PA_SC_MODE_CNTL_0.MSAA_ENABLEclear is drawn as one sample at the pixel center (debt entry "A one-sample target under a multisampled rasterizer without MSAA_ENABLE"). WithDB_EQAA.INTERPOLATE_COMP_Zset it threw instead: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, a sample-mask export, or DB_EQAA Z interpolation or overrasterization.INTERPOLATE_COMP_Z(bit 18) is now accepted on this path.INTERPOLATE_SRC_Z(bit 19),OVERRASTERIZATION_AMOUNT(bits 24-26) andENABLE_POSTZ_OVERRASTERIZATION(bit 27) still throw, and the message now says "DB_EQAA source Z interpolation or overrasterization".MSAA_ENABLE, a single-sample scan into a multisampled depth target) are unchanged.GPU semantics, with sources:
INTERPOLATE_COMP_Z, and neither AMD driver sets it: PAL writes 0 with the comment "INTERPOLATE_COMP_Z should always be set to 0", and radeonsi leaves it 0. radeonsi's comment on Z/S samples below the coverage count (L3324-L3329) says the DB derives the missing samples' Z from the Z planes when Z is compressed, which is the kind of choice the bit's name suggests.MSAA_ENABLEdebt entries already make, from RADV 061bc615 and the GL multisample rules they cite. So the interpolated Z is the center's Z, which the one-sample draw already tests and writes. This is not measured on hardware, and the debt entry says so.Why: Gran Turismo 7 (PPSA01317) draws its 3840x2160 main pass this way right after its EQAA pass (#9700):
PA_SC_AA_CONFIG0x0020c002 (4 samples),PA_SC_MODE_CNTL_00x2,DB_EQAA0x00050000 (HIGH_QUALITY_INTERSECTIONSandINTERPOLATE_COMP_Z),DB_Z_INFO0xa2900983 (one-sample Z_32_FLOAT with HTILE), an 8-bit stencil and a one-sample color target or none. It stops on this refusal when it loads the World Map.Tested
main0db47b263(head594f57aef; 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), with its diagnostic switches that skip refused compute dispatches. The stack predatesc2764f31f, so this commit went onto it as the same one-mask change.shader 0x1280659800 stage 2: ShaderRecompiler::Recompile: tessellation lowering: unsupported tessellation ring access at pc 0x28c.SPI_PS_INPUT_ENA0x2 and 0xb01, both withDB_EQAA0x00050000 andPA_SC_MODE_CNTL_10. It stopped on the same tessellation refusal in another shader (0x1280dcce00 at pc 0xd0c). Six other draws of this pass also readANCILLARY, which still throws here; the runs stopped before reaching them.Windows 11 (build 26200), NVIDIA GeForce RTX 4090 (driver 616.92), MinGW GCC Release build with
BUILD_TESTING=ON, all on one machine.mainmerge). These areagc_driver_graphics_tests(the CPU decode tests, with the new cases) and 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.f1a969f80, which mergesmain7e69be679): 62/62 passed, each test run three times (ctest --repeat until-fail:3).VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0),ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1withctest -V, onmain83462cc57(7e69be679plus eight commits totools/only) (62/62) and on this PR (62/62). Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS. Neither log has aVUID-line. Both have the same threeUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings, frommain'sagc_driver_alpha_to_coverage.mainmerge (e0c67af31onmain7e2ba73e4): 61/61 three times, and 61/61 under the layer.maincontrol there:main7e2ba73e4with only this PR'stests/Graphics.cpp.agc_driver_graphicsfails withunexpected failure: AGC graphics: a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported ....DB_EQAA0x00040000 (INTERPOLATE_COMP_Zalone) and GT7's 0x00050000 decode as a one-sample draw with no sample locations or per-sample shading, and the draw precheck accepts them.INTERPOLATE_SRC_Z, the second withINTERPOLATE_COMP_Z), 0x01010002 (OVERRASTERIZATION_AMOUNT) and 0x08010002 (ENABLE_POSTZ_OVERRASTERIZATION) still throw.tools/check_conventions.py --base origin/mainreports no errors; its one warning is the length of the existing debt entry this PR edits.Checklist
main; no other open PR implements the same functions. #8121 (PS_ITER_SAMPLEinto a one-sample color target) and #9450 change neighbouring rules, not this bit. #8121's diff shows thisRequireonly because its base predatesc2764f31f, whichmainhas. #8871 (lines withMSAA_ENABLEclear), now merged, refuses line and point lists on this path; themainmerge keeps its debt sentence and test loop next to this PR's.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:01:37Z.
Review: APPROVED
Reviewed the exact PR head
e0c67af31fagainst current upstream/main. The mask change accepts INTERPOLATE_COMP_Z while continuing to reject INTERPOLATE_SRC_Z and both overrasterization fields; the regression cases cover the bit alone and GT7’s 0x00050000 value, with and without a one-sample color target. The changed code/tests/debt entry merge cleanly with current main, diff-check passes, and the current conventions checker reports 0 errors (one existing debt-length warning). I could not rerun the focused C++/Vulkan tests locally: there is no build tree here and the filesystem is full, so I am relying on the clearly described author-reported Windows RTX 4090 results (61 focused tests, repeated three times, with a baseline control and validation-layer run) rather than claiming an independent test run. No blocking code issue found.