Skip to content

fix(agc): accept DB_EQAA INTERPOLATE_COMP_Z for a one-sample depth target without MSAA_ENABLE - #9721

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
frankea:fix/one-sample-depth-comp-z
Oct 24, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
frankea:fix/one-sample-depth-comp-z

Conversation

@frankea

@frankea frankea commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

A one-sample depth target under a multisampled rasterizer with PA_SC_MODE_CNTL_0.MSAA_ENABLE clear is drawn as one sample at the pixel center (debt entry "A one-sample target under a multisampled rasterizer without MSAA_ENABLE"). With DB_EQAA.INTERPOLATE_COMP_Z set 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) and ENABLE_POSTZ_OVERRASTERIZATION (bit 27) still throw, and the message now says "DB_EQAA source Z interpolation or overrasterization".
  • The other paths that refuse these bits (a multisampled depth target without MSAA_ENABLE, a single-sample scan into a multisampled depth target) are unchanged.
  • The debt entry says the bit is accepted, why, and that it rests on the entry's existing inference.

GPU semantics, with sources:

  • The field positions are from Mesa's gfx10.json. No public source describes 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.
  • Whatever positions the bit interpolates Z to, on this path every sample is at the pixel center. That is the inference the two MSAA_ENABLE debt 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_CONFIG 0x0020c002 (4 samples), PA_SC_MODE_CNTL_0 0x2, DB_EQAA 0x00050000 (HIGH_QUALITY_INTERSECTIONS and INTERPOLATE_COMP_Z), DB_Z_INFO 0xa2900983 (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

Windows 11 (build 26200), NVIDIA GeForce RTX 4090 (driver 616.92), MinGW GCC Release build with BUILD_TESTING=ON, all on one machine.

  • Focused set: the 62 ctest entries of 18 targets (61 before the main merge). These are agc_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.
  • This PR (f1a969f, which merges main 7e69be6): 62/62 passed, each test run three times (ctest --repeat until-fail:3).
  • Validation layer: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0), ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 with ctest -V, on main 83462cc (7e69be6 plus eight commits to tools/ only) (62/62) and on this PR (62/62). Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS. Neither log has a VUID- line. Both have the same three Undefined-Value-ShaderOutputNotConsumed-DynamicRendering warnings, from main's agc_driver_alpha_to_coverage.
  • Before the main merge (e0c67af on main 7e2ba73): 61/61 three times, and 61/61 under the layer. main control there: main 7e2ba73 with only this PR's tests/Graphics.cpp. agc_driver_graphics fails with unexpected failure: AGC graphics: a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported ....
  • The new CPU cases, with and without a one-sample color target:
    • DB_EQAA 0x00040000 (INTERPOLATE_COMP_Z alone) and GT7's 0x00050000 decode as a one-sample draw with no sample locations or per-sample shading, and the draw precheck accepts them.
    • 0x00090002 and 0x000d0000 (INTERPOLATE_SRC_Z, the second with INTERPOLATE_COMP_Z), 0x01010002 (OVERRASTERIZATION_AMOUNT) and 0x08010002 (ENABLE_POSTZ_OVERRASTERIZATION) still throw.
  • Not run on Linux. tools/check_conventions.py --base origin/main reports no errors; its one warning is the length of the existing debt entry this PR edits.

Checklist

…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.
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8121 docs/dev/debt/libSceAgcDriver.md L40
PR 8424 docs/dev/debt/libSceAgcDriver.md L39-40

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7307 docs/dev/debt/libSceAgcDriver.md
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7618 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7844 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8223 docs/dev/debt/libSceAgcDriver.md
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8365 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9348 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9393 docs/dev/debt/libSceAgcDriver.md
PR 9431 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9508 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9673 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9675 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9676 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9685 docs/dev/debt/libSceAgcDriver.md
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9842 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9879 docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9892 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9904 docs/dev/debt/libSceAgcDriver.md
PR 9905 docs/dev/debt/libSceAgcDriver.md
PR 9906 docs/dev/debt/libSceAgcDriver.md
PR 10064 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10348 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10359 docs/dev/debt/libSceAgcDriver.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@MarcZX10

Copy link
Copy Markdown
Contributor

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.

@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026
@oneandonlydean
oneandonlydean merged commit b6198d2 into boykopovar:main Oct 24, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants