Skip to content

fix(agc): accept ANCILLARY under PS_ITER_SAMPLE for a one-sample depth target without MSAA_ENABLE - #26182

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
adam25136:fix/agc-one-sample-target-sample-index
Nov 29, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
adam25136:fix/agc-one-sample-target-sample-index

Conversation

@adam25136

Copy link
Copy Markdown
Contributor

What

With more than one sample in PA_SC_AA_CONFIG and PA_SC_MODE_CNTL_0.MSAA_ENABLE clear, DecodeState draws a one-sample depth target as a one-sample draw at the pixel center (debt entry A one-sample target under a multisampled rasterizer without MSAA_ENABLE). Since #9988 a running pixel program there may read ANCILLARY, but not under PA_SC_MODE_CNTL_1.PS_ITER_SAMPLE: 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 input under PS_ITER_SAMPLE, a coverage input, a sample-mask export, or DB_EQAA source Z interpolation or overrasterization.

#9988, which accepted ANCILLARY on this depth path without PS_ITER_SAMPLE, kept this case: "With 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." (#13991 kept the same case on the color path.) Under the entry's model a one-sample target keeps the coverage of sample 0, so of those invocations the depth target keeps the one for sample 0, and index 0 is what the one-sample draw already gives: its state has one sample, so perSampleShading is false, the recompiler's pixelIteratesSamples is false, and the sample field of the packed ancillary word is the constant 0 (sampleNumber in ConstantFolder.cpp). Like the entry's model, this is not measured on a console. main already uses this rule in two neighbouring cases:

  • with MSAA_ENABLE set, the sample-0 rule (rasterizesSampleZeroOnly in State.cpp) refuses only SAMPLE_COVERAGE under PS_ITER_SAMPLE, so a program that reads ANCILLARY is drawn as one sample and reads index 0;
  • the debt entry One-sample color targets beside a multisampled depth target: "With PS_ITER_SAMPLE the color is the output of sample 0's invocation."

This PR:

  • drops ANCILLARY under PS_ITER_SAMPLE from the one-sample depth check in State.cpp. SAMPLE_COVERAGE and a sample-mask export still throw. The one-sample color check is not changed: no title I know of reaches it with ANCILLARY under PS_ITER_SAMPLE.
  • changes the debt entry through a fragment: ANCILLARY throws only under PS_ITER_SAMPLE without a depth target; with one, the program reads sample index 0, and if the console keeps another sample, a program that kills or writes by the index draws differently; a store whose address or value depends on the index is made only as sample 0 would make it; inFAMOUS joins the titles listed.

inFAMOUS Second Son (CUSA00223) stops at this check: a depth-only draw into a one-sample 3328x1920 depth target under a 2x PA_SC_AA_CONFIG (0x00108001), with PS_ITER_SAMPLE set and KILL_ENABLE set in DB_SHADER_CONTROL (0x60). Its pixel program reads PERSP_SAMPLE and ANCILLARY (SPI_PS_INPUT_ENA 0x2001) and takes bit 8 of ANCILLARY, the low bit of the sample index. It puts that bit into the lowest bit of the first coordinate of each of its 7 image sample addresses, and decides the kill by comparing differences between the sampled values with 0.1.

Tested

Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 5080 (driver 621.14), WinLibs GCC 15.2.0 (r7), Release. The tests, the breaks and the inFAMOUS starts ran on this change on main fe540db950; it is now on 709342e209. None of the main commits in between change a file this PR changes, and its changed lines are the same.

  • agc_driver_one_sample_depth_sample_index (new, PM4 through sceAgcDriverSubmitDcb, modeled on DepthCopyDraw.cpp): a depth-only draw into a one-sample 64x4 depth target with MSAA_ENABLE clear and PS_ITER_SAMPLE set, whose pixel program reads PERSP_CENTER and ANCILLARY (0x2002), kills (KILL_ENABLE) unless bits 8-11 of ANCILLARY are 0 and exports only to the null target; a DB depth copy then reads the depth target into a color target, and a reference draw marks the covered texels. Under one-sample, 2x, 4x and 8x configurations, the copy holds the drawn depth exactly where the reference draw covers and nothing elsewhere.
  • agc_driver_graphics: a one-sample depth target under a 4x configuration whose running pixel program reads PERSP_SAMPLE and ANCILLARY (0x2001, inFAMOUS's inputs) under PS_ITER_SAMPLE decodes as one sample without sample shading, with no color target and with a one-sample one; the precheck accepts it.
  • Both pass, and each of 3 deliberate breaks fails at least one of them: main's refusal put back (both fail, the GPU test with this check's refusal), the depth path left at the rasterizer's sample count (both fail), and the non-iterated sample index read as 1 instead of 0 (the GPU test fails in all four rounds: the copy holds 0 instead of 0.25 at the first covered texel).
  • The SPIR-V-tools build (ANYPS5_ENABLE_SPIRV_TOOLS=ON, Release), of this branch on main 709342e209: both pass.
  • The two runs below used an earlier version of the new test, whose kill program exported to color target 0. Since then it exports to the null target and reports every round that fails, and that version was rerun alone.
  • The 3,442 tests tools/select_tests.py selects for the 4 changed files (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), on this branch and on main fe540db950 (3,441, without the new test): agc_driver_bda_device and agc_storage_write_back_host_retile fail on both, agc_driver_store_over_untracked failed only on main, and the same 24 tests are skipped on both.
  • With VK_LAYER_KHRONOS_validation 1.4.367 (VK_ADD_LAYER_PATH=<the layer's folder> VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer VK_LOADER_LAYERS_DISABLE=~implicit~ ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1), the tests matching multisample|msaa|one_sample|sample_iteration|sample_coverage|sample_mask|sample_order|ancillary|depth_copy|agc_driver_graphics$|alpha_to_coverage, ctest -V: 71 on the branch and 70 on main; 67 and 66 pass, and the same 4 are skipped on both (agc_driver_msaa_dcc_compared_import_2, _4 and _8, agc_driver_sample_order_grid_reference); the logs have 72 and 70 Insert instance layer lines, no was not found and no VUID. In that run the new test's kill program still exported color target 0, and the layer warned Undefined-Value-ShaderOutputNotConsumed-DynamicRendering once per kill draw (the depth-only draw has no color attachment; main logs the same warning in agc_driver_alpha_to_coverage). With the null export, rerun alone with the layer, the test passes with no validation message.
  • inFAMOUS Second Son (CUSA00223 01.07, my own dump; it runs in PS4 Pro mode): eboot, libc.prx and libSceFios2.prx unwrapped with our local PS4 variant of tools/unwrap_self.py, converted with each build's relinker (--windows --registry --trace-imports), two starts of up to 60 s per build, no input. Both builds are main fe540db950 with fix(libSceSysmodule): accept four PS4-only module ids in a PS4 process #18184, feat(shader): offer a 2D MSAA mode to GCN image loads #21961, feat(agc): sample and publish PS4 multisampled depth targets #25557 and feat(agc): model the color memory of PS4 multisampled 2D surfaces #25802 (which carries feat(agc): lay out PS4 multisampled color textures in 2D tile modes #23672) merged locally (feat(agc): lay out PS4 multisampled color textures in 2D tile modes #23672 and feat(agc): sample and publish PS4 multisampled depth targets #25557 conflict in TextureTiling.cpp; resolved by keeping feat(agc): sample and publish PS4 multisampled depth targets #25557's depth tile split and feat(agc): lay out PS4 multisampled color textures in 2D tile modes #23672's color tile split) and two local relinker changes in no PR, so the Neo-mode GNM exports it imports resolve (see libSceGnmDriver: inFAMOUS Second Son (CUSA00223) stops at load on 47 imports that only libSceGnmDriverForNeoMode exports #17581): a title that needs libSceGnmDriver.prx also loads libSceGnmDriverForNeoMode.prx, and an import of libSceGnmDriver.prx is also looked up in it. The build without this change merged feat(agc): sample and publish PS4 multisampled depth targets #25557 at aeae68c7f0 and the one with it at 96c16c16d8; they differ only in a debt fragment.
    • without this change: both starts stop after 21.2 s and 21.3 s at the refusal above;
    • with it: both get past that draw and stop after 22.0 s and 21.9 s at a later draw, with indirect draw on a non-vertex path must be resolved by the driver, which is outside this PR. The logs count no frames; both builds' starts log [videoout] presentation failed at their stop, and the starts with this change prepare 8 more graphics shaders at first use (57 against 49), among them the refused draw's pixel program 0x2f2f95f00. The time to the stop is about the same; what changes is where they stop.
  • python tools/check_conventions.py --base origin/main with this title and description: no errors, one warning, debt-length, for the changed entry (5,001 characters; it was 4,335 before this change).
  • python tools/pr_overlap.py --branch fix/agc-one-sample-target-sample-index (2,538 open pull requests probed): none of those that merge with main conflicts with this branch. Of the 33 that conflict with main and were not compared, none changes a line inside this branch's hunks.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: CUSA00223 inFAMOUS Second Son (CUSA00223) #8214
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 621.14, Windows 10 22H2
  • AI-assisted: yes

AI-assisted: Claude Code found the cause, wrote the change and its tests, ran the tests and the inFAMOUS starts, and drafted this description; separate review agents checked it.

🤖 Generated with Claude Code

…h target without MSAA_ENABLE

With more than one sample in PA_SC_AA_CONFIG and MSAA_ENABLE clear, a
one-sample depth target is drawn as a one-sample draw, which gives a
pixel program sample index 0 from ANCILLARY whether or not
PS_ITER_SAMPLE is set. Under the debt entry's model, where a one-sample
target keeps the coverage of sample 0, the console's invocation for
sample 0 is the one the target keeps, as for a one-sample color target
beside a multisampled depth target. Stop refusing ANCILLARY under
PS_ITER_SAMPLE on this depth path; SAMPLE_COVERAGE inputs and
sample-mask exports still throw, and the color path is unchanged.

inFAMOUS Second Son (CUSA00223) stops at this check: a depth-only draw
under a 2x configuration whose pixel program reads bit 8 of ANCILLARY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mihiii1337 mihiii1337 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 exact head 531c3c540f51fa6625c1854b21fe39ee8c723a68.

I ran a focused native Windows A/B with GCC 15.2, compiling each revision's exact State.cpp and the one-sample section of the PR's Graphics.cpp test against the same cached supporting libraries. The base failed at its ANCILLARY refusal and the PR passed DecodeState and DrawRejection. In additional runs with and without a color attachment, an active SAMPLE_COVERAGE input and a sample-mask export were still rejected.

A separate 768-case check of the exact guard across 2×, 4× and 8× configurations found only the three expected acceptance changes. The three changed C++ files also passed syntax checks with the pinned Vulkan and SPIR-V headers.

My tests exercise CPU state decoding. The console sample-zero behavior remains the documented inference, and the GPU runs in the PR description are the author's results.

AI-assisted: yes

@tablefrogpillow

Copy link
Copy Markdown
Contributor

Verified on real AMD RADV (Linux) across all three gens — the PR lists NVIDIA RTX 5080 only. Built the PR head 531c3c540f51 and ran agc_driver_one_sample_depth_sample_index under ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 with Khronos validation 1.4.363 inserted (confirmed Insert instance layer, no was not found):

GPU Arch Result VUID-
RX Vega 56 (RADV VEGA10, gfx900) GCN5 pass 0
RX 7900 GRE (RADV NAVI31, gfx1100) RDNA3 pass 0
Ryzen 7800X3D iGPU (RADV RAPHAEL, gfx1036) RDNA2 pass 0

All three pass a PS_ITER_SAMPLE pixel program that kills unless the ANCILLARY ... with zero VUID-.

No regression in the related family either — on NAVI31 these all still pass on this head: one_sample_depth_sample_index, pixel_ancillary_word, relative_ancillary, sample_mask_depth_stencil, sample_mask_draw, sample_mask_multisample, alpha_to_coverage, native_depth_bda_clear.

Sample-index / ANCILLARY handling for a one-sample depth target under a multisampled rasterizer is AMD-specific (EQAA/DB), so this adds the AMD-RADV side across GCN5/RDNA2/RDNA3 to the NVIDIA coverage.

Evidence: VERIFIED (reproduced on each GPU under the above conditions).
AI-assisted: yes

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line docs agc libSceAgc* labels Nov 23, 2026
@Helldiverr

Copy link
Copy Markdown
Contributor

Looks good on AMD RDNA4 on Windows with the Khronos validation layer. The new test and the neighbouring ANCILLARY and sample-mask tests pass 3/3 on the head, with 0 VUID- and 0 synchronization hazards. With only the PR's two test files on main, both tests fail at the refusal this PR removes.

What this run adds.

  • Earlier runs:
    • the author's runs on an RTX 5080 on Windows, with the layer;
    • tablefrogpillow's runs on AMD RADV on Linux (Vega 56, RX 7900 GRE, a Raphael iGPU), with the layer;
    • mihiii1337's CPU A/B of DecodeState.
  • This run adds:
    • the first run on AMD's Windows driver and on RDNA4 (driver 32.0.31044.16), with the layer and with synchronization validation;
    • the negative control on main.

Code.

  • State.cpp:1801-1802 (head): the one-sample depth check no longer adds ANCILLARY to the refused inputs under PS_ITER_SAMPLE.
    • SAMPLE_COVERAGE, a sample-mask export (0x203 bit 8), points and lines, alpha-to-coverage and the DB_EQAA bits still throw, as before.
    • The message drops "a sample index input under PS_ITER_SAMPLE" to match.
  • Graphics.cpp:1033-1034 adds the inFAMOUS inputs (0x2001) to the existing one-sample PS_ITER_SAMPLE case.
  • The new GPU test is tests/execution/OneSampleDepthSampleIndex.cpp.
  • The debt fragment changes the entry's text to match.
  • Conventions.
    • No comments are added.
    • tools/check_conventions.py --base 709342e209 and tools/debt_fold.py --check pass on the head.

Negative control.

  • I copied only the PR's OneSampleDepthSampleIndex.cpp and Graphics.cpp onto main 709342e209 and rebuilt.
  • agc_driver_one_sample_depth_sample_index aborts (0xc0000409), and agc_driver_graphics fails.
  • Both stop at 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 input under PS_ITER_SAMPLE, .... That is the refusal this PR removes.

GPU. Head 531c3c540f is based on main 709342e209, so the merge is the head itself:

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R "^agc_driver_(one_sample_depth_sample_index|graphics|pixel_ancillary_word|relative_ancillary|sample_mask_depth_stencil|alpha_to_coverage)$" -V
run one_sample_depth_sample_index graphics pixel_ancillary_word relative_ancillary sample_mask_depth_stencil alpha_to_coverage
main not on main Passed Passed Passed Passed Passed
main, PR tests only Abort (refusal) Failed (refusal) not run not run not run not run
head 1 Passed Passed Passed Passed Passed Passed
head 2 Passed Passed Passed Passed Passed Passed
head 3 Passed Passed Passed Passed Passed Passed
main, sync validation not on main Passed Passed Passed Passed Passed
head, sync validation Passed Passed Passed Passed Passed Passed

The new test selected AMD Radeon AI PRO R9700 vendor=0x1002 device=0x7551 and logged no validation message.

Validation.

  • Insert instance layer "VK_LAYER_KHRONOS_validation" appears 4 times on main and 6 times on each head run. The extra 2 are in the new test.
  • No log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
  • VUID- lines: 0 in every log.
  • With VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true added, both main and the head have 0 SYNC-HAZARD- lines and 0 VUID- lines.
  • The only validation messages are three Undefined-Value-ShaderOutputNotConsumed-DynamicRendering warnings in agc_driver_alpha_to_coverage. They appear the same on main and on the head, as the description notes.

Host:

  • GPU: AMD Radeon AI PRO R9700 (gfx1201, 1002:7551), driver 32.0.31044.16, Vulkan 1.4.349
  • Validation layer: Khronos validation layer 1.4.363 (LunarG SDK)
  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits: main 709342e209, head 531c3c540f (fast-forward of main)

AI-assisted: yes

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10351 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13928 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13929 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15570 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17611 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 19821 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20010 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20153 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20845 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22514 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 23252 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23281 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23818 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24049 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24083 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24327 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25534 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25684 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 26084 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26197 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26630 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26706 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28142 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@nexus1692

Copy link
Copy Markdown
Contributor

Independent Windows 11 / RTX 5070 Ti (Blackwell) validation of agc_driver_one_sample_depth_sample_index

The PR's Tested block is Windows 10 on an older NVIDIA card, so this is a native Windows 11 run on a Blackwell GPU with the Khronos validation layer inserted at instance and device, plus a base/implementation-revert control.

Hardware and toolchain

OS Windows 11 (x86-64)
Compiler WinLibs GCC 16.2.0 (MinGW-w64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r3)
CMake / Ninja 4.4.4 / 1.13.2, CMAKE_BUILD_TYPE=Release, BUILD_TESTING=ON
GPU NVIDIA GeForce RTX 5070 Ti 16 GB, vendor=0x10de device=0x2c05, driver 621.24
Validation layer VK_LAYER_KHRONOS_validation 1.4.363 from Vulkan SDK 1.4.363 (headers at 335)
Environment ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer
Head 531c3c540f51fa6625c1854b21fe39ee8c723a68
Base for the control 709342e209 (merge base with main)

Build

cmake -S . -B build      # exit 0, the new tests/execution/OneSampleDepthSampleIndex.cpp is picked up by the glob
ninja -C build agc_driver_one_sample_depth_sample_index_tests

Exit 0, plus the usual MinGW .rsrc merge failure: multiple non-default manifests link warning.

Results on head

ctest --test-dir build -R '^agc_driver_one_sample_depth_sample_index$' -V, 3 consecutive runs:

Run Result Device line Instance layer Device layer was not found… VUID-
1 Passed, 1.74 s vendor=0x10de device=0x2c05 2 2 0 0
2 Passed, 0.91 s vendor=0x10de device=0x2c05 2 2 0 0
3 Passed, 0.99 s vendor=0x10de device=0x2c05 2 2 0 0

Two insertions per run because the suite creates and tears down the device twice (once for the capability probe in main, once for the actual render). The verdict line is the suite's own, not a skip:

a PS_ITER_SAMPLE pixel program that kills unless the ANCILLARY sample index is 0 wrote a one-sample depth target
without MSAA_ENABLE wherever its draw rasterized, under one-sample, 2x, 4x and 8x configurations

So the one-sample, 2x, 4x and 8x paths all ran on this device; OpenVulkanTestDevice() returning nothing would have produced return code 77 and a skipped line instead.

Negative control (implementation reverted, new test kept)

The test file is new in this PR, so the ctest name does not exist at 709342e209. With the PR's test and registration kept and only core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp checked out at the base commit, the build is clean and the test fails at the configuration the change exists for:

[gpu] driver failure: AGC graphics: 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 input under PS_ITER_SAMPLE, ...
what():  AGC graphics: a one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is unsupported ...
1/1 test failed, exit code 0xc0000409

The base rejects the configuration outright, so the test distinguishes base from head rather than passing on both.

What this does and does not establish

Establishes, on native Windows 11 with GCC 16.2.0/UCRT in Release on an RTX 5070 Ti:

  • agc_driver_one_sample_depth_sample_index configures, builds and passes on Windows, 3/3 runs (1.74 s, then 0.91 s and 0.99 s), deterministically;
  • it creates a real Vulkan device on this GPU (device=0x2c05), with VK_LAYER_KHRONOS_validation inserted for every instance and device, no loader complaint (was not found) and zero VUID- lines;
  • the assertions bind to State.cpp: reverting only that file makes the same test abort with the "one-sample depth target … unsupported" driver failure.

Does not establish:

  • console behaviour: this shows the recompiled pipeline and the AGC state accept the configuration on an NVIDIA driver; it does not show a PS5 produces the same depth values;
  • the depth value comparison itself against hardware: the check is the test's own DrawnDepth/Untouched expectation, not a console capture;
  • other GPUs and drivers: one Blackwell card, driver 621.24. The ANCILLARY/PS_ITER_SAMPLE interaction is driver-specific enough that RADV or MoltenVK could differ, and the PR's own Windows 10 run used a different card;
  • no title or homebrew run, and no console sink.

Workspace cleaned up afterwards: temporary branch deleted, main back at origin/main (110d1fcd39), no local changes.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

NVIDIA Ampere run of the Tested selection: no regression.

Setup: NVIDIA GeForce RTX 3070, driver 616.56, Windows 11 Pro 10.0.26100, WinLibs GCC 15.2.0 r7, Release, Vulkan validation layer 1.4.363. Base main 61f7f5925c; head 531c3c540f merged onto it with --no-ff. Env: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^(agc_driver_alpha_to_coverage.*|agc_driver_bda_device|agc_driver_graphics|agc_driver_msaa_dcc_compared_import_2|agc_driver_one_sample_depth_sample_index.*)$' -V, 3 runs each.

  • main: 5 passed, 1 skipped, 0 failed in 3 of 3 runs.
  • this PR: 6 passed, 1 skipped, 0 failed in 3 of 3 runs (the extra one is the new test).
  • 0 VUID- messages on either side; the loader inserted the validation layer in every run.
  • The skip is the same on both sides: agc_driver_msaa_dcc_compared_import_2 skips on Windows by design ("Linux comparison mode only").

AI-assisted (Claude Code).

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 25, 2026

@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 — looks good

Nothing blocks this change; the behavior is supported by the code and test evidence described in the PR, with console behavior still unverified.

What I ran

Reviewed head 531c3c540f51fa6625c1854b21fe39ee8c723a68 using the prepared diff and repo_read.py. No tests were run during this review.

Results

Check Result Note
Changed code review passed State check and execution test inspected
Tests during review not run PR description reports author runs
Console behavior not run Description says behavior is inferred, not measured

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full Graphics.cpp file was inspected only at the changed lines; its remaining contents were not read. The PR description, commits, manifest, diff, State.cpp, new execution test, and debt fragment were read. The author reports tests and title launches, but those were not run by this review. No precheck or negative control was run. Console behavior and the other modified-file context were not independently confirmed.

To get this to a good state

Nothing is required.

@oneandonlydean
oneandonlydean merged commit b7ac48e into boykopovar:main Nov 29, 2026
14 checks passed
@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 29, 2026
oneandonlydean pushed a commit that referenced this pull request Dec 6, 2026
…r target without MSAA_ENABLE

With more than one sample in PA_SC_AA_CONFIG and MSAA_ENABLE clear, a
one-sample color target and no depth target is drawn as a one-sample
draw, which gives a pixel program sample index 0 from ANCILLARY whether
or not PS_ITER_SAMPLE is set. Under the debt entry's model, where a
one-sample target keeps the coverage of sample 0, the console's
invocation for sample 0 is the one the target keeps. This is not
measured on hardware. This is the color half of the depth-path change in
#26182. Stop refusing ANCILLARY under PS_ITER_SAMPLE on the color path;
SAMPLE_COVERAGE inputs and sample-mask exports still throw. A GPU test
draws such a program under 2x, 4x and 8x configurations and checks that
it wrote sample index 0, as under a one-sample configuration.

inFAMOUS Second Son (CUSA00223) stops at this check: a one-sample color
target under a 2x configuration whose pixel program reads ANCILLARY under
PS_ITER_SAMPLE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

8 participants