Repository navigation
fix(agc): accept DB_EQAA INTERPOLATE_COMP_Z for a one-sample depth target without MSAA_ENABLE - #9721
Conversation
…rget without MSAA_ENABLE A one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is drawn as one sample at the pixel center, but DB_EQAA INTERPOLATE_COMP_Z threw on it. Gran Turismo 7 (PPSA01317) draws its 3840x2160 main pass this way after its EQAA pass (PA_SC_AA_CONFIG 0x0020c002, PA_SC_MODE_CNTL_0 0x2, DB_EQAA 0x00050000, a Z_32_FLOAT depth target with one sample) and stops on it. On this path every sample is taken to be at the pixel center, so Z interpolated to any sample position is the center's Z, which the one-sample draw already tests and writes. INTERPOLATE_COMP_Z is now accepted there. INTERPOLATE_SRC_Z and overrasterization still throw. Neither PAL nor radeonsi sets the bit and its meaning is not documented, so the debt entry records this as the same inference.
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the exact PR head e0c67af against 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.
…comp-z # Conflicts: # core/libs/prx/libSceAgcDriver/tests/Graphics.cpp # docs/dev/debt/libSceAgcDriver.md
|
I’ve noticed my earlier broad request to hold PRs based on #5239 was unnecessary. It is fine to keep creating PRs; maintainers will review them in due course. Please disregard my request to hold this PR. Separately, the title-specific evidence here and whether it meets the maintainer’s request remain for maintainers to assess. |
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
main0db47b2 (head 594f57a; 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.main0db47b2 passes 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 (fix(agc): write a replace blend into a packed color target without blending #7243, feat(agc): render layered draws into a depth view of several slices #7256, fix(shader): answer image_get_resinfo on any T# dimension #7550, fix(agc): raise no end-of-pipe event from flips and carry the release's interrupt context #7978, feat(agc): merge partial writes into 4_4_4_4 UNORM color targets #8564, feat(agc): blend into 11_11_10 float color targets in the pixel shader #9020, feat(agc): draw alpha-tested packed-target merges that write depth as a depth pass and an EQUAL merge pass #9335, fix(shader): link table callees that together exceed s_call_b64 range #9068, feat(agc): draw EQAA color targets at their coverage sample count #9700), with its diagnostic switches that skip refused compute dispatches. The stack predates c2764f3, 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.main7e69be6): 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, onmain83462cc (7e69be6 plus 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 (e0c67af onmain7e2ba73): 61/61 three times, and 61/61 under the layer.maincontrol there:main7e2ba73 with 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. fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample color target #8121 (PS_ITER_SAMPLEinto a one-sample color target) and fix(agc): draw a one-fragment multisampled color target as one sample with sample 0's coverage #9450 change neighbouring rules, not this bit. fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample color target #8121's diff shows thisRequireonly because its base predates c2764f3, whichmainhas. fix(agc): draw line lists and strips into a multisampled target with MSAA_ENABLE clear #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)