Skip to content

feat(agc): draw PS4 EQAA and one-fragment color targets - #18176

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
puridanish284:claude/zealous-brown-h1u67r
Nov 14, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
puridanish284:claude/zealous-brown-h1u67r

Conversation

@puridanish284

@puridanish284 puridanish284 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

A PS4 (GCN) color target with fewer fragments than samples (CB_COLOR_ATTRIB NUM_FRAGMENTS below NUM_SAMPLES) stopped the run with AGC graphics: GCN color targets with fewer fragments than samples (EQAA) are not implemented. It is the current stop of Grand Theft Auto V (CUSA00419) after 34.5 s, blocker 7 in #18084, which no issue or pull request tracked.

DecodeGcnColorBuffer now reads these targets as the AGC path's decoder has since #9700 and #9450:

  • 2 or 4 fragments of 4 or 8 samples (EQAA): samples is the coverage sample count and eqaaFragments the fragment count, so the target is drawn at its coverage samples as a host-resident target (feat(agc): draw PS4 multisampled color targets as host-resident targets #9892), with its color memory guarded over the fragments it stores. It needs CB_COLOR_INFO COMPRESSION and a CB_COLOR_FMASK base, as on the AGC path, and throws without them.
  • 1 fragment of 2, 4 or 8 samples: one stored sample with coverageSamples set, drawn by the AGC path's one-fragment code. With COMPRESSION its FMASK base is recorded, and that code guards it.
  • More fragments than samples throws.

The AGC path sizes both FMASK guards (fmaskBytes and GuardOneFragmentFmask) with the SW_64KB_Z_X layout, which does not hold for GCN tiling: for a 64x64 target they guard 64 KiB where the PS4 FMASK is 4 KiB, so later guest data in that range would be refused. A GCN target now records the size CB_COLOR_FMASK_SLICE gives in ColorTarget::gcnFmaskBytes, and both guards use it for GCN tile modes: (tile max + 1) × 64 pixels of

Fragments FMASK bits per pixel addrlib SiLib::HwlComputeFmaskBits
1 8, whatever the coverage sample count bpp = 1, numSamples = 8
2 2 × samples bpp = 2
4 4 × samples bpp = 4

A slice is pitch × height × bpp × samples bits in addrlib's macro-tiled layout, and Mesa programs TILE_MAX as pitch × height / 64 − 1 of the FMASK surface (ac_surface.c). The register fields are GFX7's from Mesa's gfx7.json. gcnFmaskBytes is 32 bits (at most 2^22 tiles × 64 pixels × 32 bits = 1 GiB) and fills padding after fmaskPipeBankXor, so sizeof(State) stays 952 and the pipeline journal, which records no FMASK field, is unchanged.

Update, 2026-11-12, later array slices (f348629c5c, with main c85dcfd005 merged in as b58d7b1f4d): a CB_COLOR_VIEW of slice n of a target storing 2 or more fragments started n single-sample slices past CB_COLOR_BASE, as on main, and its CMASK and FMASK at their bases. A slice holds all stored fragments, as addrlib sizes it with its samples (egbaddrlib.cpp), and Mesa programs the color, CMASK and FMASK bases for slice 0 and the layer only in CB_COLOR_VIEW (ac_descriptors.c, L1177), so the CB steps all three per slice. Slice n of a multisampled, EQAA or one-fragment target now starts n slices of its stored fragments past the base, and its CMASK and FMASK n CB_COLOR_CMASK_SLICE and CB_COLOR_FMASK_SLICE sizes past theirs; a single-sample target keeps its stride. A later slice of the 2D-tiled modes still throws here; #18721 places single-sample ones.

Unchanged: FMASK contents are not modeled (the plane is guarded, never written); a one-fragment target with FAST_CLEAR still throws as a single-sample fast clear; and a PS4 multisampled target, EQAA or not, still throws when it is first drawn without a fast clear (initial multisample color contents with CMASK require a modeled metadata import, or initial multisample color footprint is not implemented without CMASK). The new test introduces its targets with a fast clear.

Debt: the "PS4 (GCN) multisampled color targets" entry now covers EQAA and one-fragment targets, the FMASK size and what still throws, and a new "PS4 (GCN) color array slice strides" entry says where a later slice, its CMASK and its FMASK start.

Overlap: tools/pr_overlap.py --branch claude/zealous-brown-h1u67r against main 9e3265259e and the 2011 open pull requests reported no overlap with those it could compare and failed closed on 39 that already conflict with main and share docs/dev/debt/libSceAgcDriver.md, State.hpp, State.cpp or MultisampleTarget.cpp with this branch. Merged into main and into this branch, each of the 39 conflicts in the same files with the same number of hunks, except #14212, which puts a blank line between all debt entries and gets one more hunk on the entry this branch rewrites; a merge keeps both. Of them, #9748, #9895, #10249 and #11551 edit State.cpp, none in the GCN color target decode or its FMASK fields, and #9895 and #11551 keep the EQAA refusal.

GTA V's target is a 4-sample, 1-fragment target with FAST_CLEAR and COMPRESSION (adam25136's run in the comments): this PR draws it as one stored sample and still refuses its fast clear, at PS4 color target fast clear (CMASK) is not implemented. #18177 materializes the fast clears of single-sample and one-fragment PS4 targets on top of this branch and depends on it; until this PR merges, #18177's diff includes it.

Tested

Windows 11 (10.0.26200.9711) with WSL2 Ubuntu 24.04.5 LTS (kernel 6.18.54.1-microsoft-standard-WSL2), gcc 13.3.0, -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON, test targets only. Vulkan device: lavapipe (llvmpipe (LLVM 20.1.2, 256 bits), Mesa 25.2.8, Vulkan 1.4.318); the machine's GeForce RTX 3080 has no Vulkan driver inside WSL2. No title or console.

  • agc_gcn_color_target (CPU): the new FewerFragmentsDecode checks 4/2, 8/2, 8/4 and 4/1 targets (samples, coverage samples, fragments, FMASK base and size, no FMASK or CMASK on an uncompressed one-fragment target) and the four refusals.
  • New agc_driver_gcn_eqaa_color_target (PS4 shader mode, hand-encoded GFX7 shaders, guest memory below 2^40): fast-clears and draws a 4-sample 2-fragment target and a 4x target with the same two triangles. Their CB resolves are identical and hold 102 quarter- or three-quarter-coverage channels; the EQAA FMASK guard ends at the 4 KiB CB_COLOR_FMASK_SLICE gives, as does that of a compressed one-fragment target, and the color guard covers the two stored fragments only. It passes 3 of 3 runs.
  • On main 946133f92f, the same test (without its two gcnFmaskBytes checks, as the field does not exist there) stops at the title's message: AGC graphics: GCN color targets with fewer fragments than samples (EQAA) are not implemented.
  • Mutation check: sizing either FMASK guard as on the AGC path fails the new test (a test read of 0x800051000+0x100 overlaps the FMASK of EQAA color target 0x800050000+0x10000, and the same for the one-fragment target).
  • AGC protocol, on main 946133f92f and on this branch, same machine, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation in the build directory: ctest -R '^(agc_gcn_color_target|agc_driver_eqaa_color_target|agc_driver_graphics|agc_driver_gcn_.*|agc_driver_.*multisample.*|agc_driver_cached_image_multisample_guard|agc_driver_sample_multisample_target)$' -E sampled_cache_budget -j 8 --timeout 300 -V: 28 of 28 pass on main, 29 of 29 on this branch. The Khronos validation layer is Ubuntu's 1.3.275, loaded through VK_LAYER_PATH; the loader logs Insert instance layer "VK_LAYER_KHRONOS_validation", and neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS. The only VUID in either log is VUID-VkDeviceCreateInfo-pNext-pNext at device creation (tests: with a Vulkan validation layer older than the repo's headers, agc_driver_image_table* fail on main from VUID-VkDeviceCreateInfo-pNext-pNext (unknown VK_KHR_shader_fma / VK_KHR_maintenance8 structs) #17693: the layer is older than the repository's headers), with the same count in every test of both runs, plus one for the new test's device.
  • python3 tools/check_conventions.py --base upstream/main: all conventions checks passed. The branch merges cleanly with main 9e3265259e, which changed none of its files.
  • Not built for Windows or macOS here (no MinGW toolchain on this machine); the new test allocates its guest block there through the guest arena, as GcnColorTarget.cpp does.
  • Not run on GTA V or any other title (I have no dump), nor on a hardware GPU.
  • 2026-11-12, head b58d7b1f4d: agc_gcn_color_target's new MultisampledSlicesDecode decodes slice 1 of a 4x array 4 single-sample slices past the base with its CMASK one CMASK slice past its base; slice 2 of a 4-sample 2-fragment array 2 × 2 slices past, with its FMASK and CMASK two of their slices past; slice 3 of a compressed one-fragment array 3 single-fragment slices past, with its FMASK three FMASK slices past; and slice 0 at the three bases. Removing the fragment factor, the CMASK offset or the FMASK offset each fails it.
  • Same head, the focused set above with the validation layer: 29 of 29 pass, and 28 of 28 on main c85dcfd005. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and every test logs the same VUID- ids and counts on both (VUID-VkDeviceCreateInfo-pNext-pNext at device creation, and 2 and 36 VUID-vkCmdDraw-None-07629 in agc_driver_native_multisample_depth and agc_driver_sample_mask_multisample), plus the new test's device-creation message.
  • The branch merges cleanly with feat(agc): materialize single-sample and one-fragment PS4 color target fast clears #18177 and feat(agc): draw into later slices of 2D-tiled PS4 color target arrays #18721; the three merged together pass agc_gcn_color_target, agc_driver_graphics, agc_driver_gcn_eqaa_color_target, agc_driver_gcn_fast_clear_color_target and agc_driver_gcn_color_array_slices.

Checklist

🤖 Generated with Claude Code

A PS4 (GCN) color target with fewer fragments than samples
(CB_COLOR_ATTRIB NUM_FRAGMENTS below NUM_SAMPLES) threw "GCN color
targets with fewer fragments than samples (EQAA) are not implemented".
It now decodes as the AGC path's EQAA and one-fragment targets do: 2 or
4 fragments are drawn at the coverage sample count with the color
memory guarded over the stored fragments, and 1 fragment is drawn as
one sample. EQAA needs COMPRESSION and a CB_COLOR_FMASK base.

The FMASK guard of the AGC path is sized with the SW_64KB_Z_X layout,
which does not hold for GCN tiling. A GCN target records its FMASK
size from CB_COLOR_FMASK_SLICE instead: tile max + 1 times 64 pixels
of 2 bits per sample for 2 fragments, 4 for 4, and 1 bit for each of 8
samples for one fragment, as addrlib's SiLib::HwlComputeFmaskBits and
ac_surface.c lay it out. The 32-bit field fills padding in ColorTarget,
so the pipeline state size and the recipe codec do not change.

GcnColorTarget covers the decode of 4/2, 8/2, 8/4 and 4/1 targets and
the refusals. GcnEqaaColorTarget draws a fast-cleared 4-sample
2-fragment target in PS4 mode, resolves it like a 4x target drawn the
same way, and checks that the FMASK guards of it and of a one-fragment
target end at the size CB_COLOR_FMASK_SLICE gives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Nov 10, 2026
@github-actions github-actions Bot added docs agc libSceAgc* labels Nov 10, 2026
@JJenkx

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Windows check of head b278e7d8de, merged onto main 6e649934bc (GPU merge 96b154d4c0; CPU merge 2835ec9665 on a336d6b892).

Setup: Windows 11 Enterprise 22621, AMD RX 6700 XT, AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release build.

  • GPU, through the shared Windows GPU FIFO with ANYPS5_REQUIRE_VULKAN=1: agc_driver_gcn_eqaa_color_target and agc_gcn_color_target passed in 3 of 3 runs, 6 of 6 outcomes. The binaries matched the hashes recorded at preparation, and the receipt shows exit 0 and app_count=0 after cleanup.
  • CPU, Vulkan hidden: agc_gcn_color_target passed and agc_driver_gcn_eqaa_color_target skipped (it needs a device), with no failures, in 3 of 3 runs.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 10, 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 1368 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7085 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9289 docs/dev/debt/libSceAgcDriver.md
PR 9335 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10049 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 10351 docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12904 docs/dev/debt/libSceAgcDriver.md
PR 13809 docs/dev/debt/libSceAgcDriver.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13963 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14344 docs/dev/debt/libSceAgcDriver.md
PR 14944 docs/dev/debt/libSceAgcDriver.md
PR 15136 docs/dev/debt/libSceAgcDriver.md
PR 15456 docs/dev/debt/libSceAgcDriver.md
PR 15529 docs/dev/debt/libSceAgcDriver.md
PR 15548 docs/dev/debt/libSceAgcDriver.md
PR 15621 docs/dev/debt/libSceAgcDriver.md
PR 16054 docs/dev/debt/libSceAgcDriver.md
PR 16483 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 16880 docs/dev/debt/libSceAgcDriver.md
PR 17024 docs/dev/debt/libSceAgcDriver.md
PR 17056 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 17611 docs/dev/debt/libSceAgcDriver.md
PR 17796 docs/dev/debt/libSceAgcDriver.md
PR 17899 docs/dev/debt/libSceAgcDriver.md
PR 17915 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 17943 docs/dev/debt/libSceAgcDriver.md
PR 17956 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 18029 docs/dev/debt/libSceAgcDriver.md
PR 18082 docs/dev/debt/libSceAgcDriver.md
PR 18102 docs/dev/debt/libSceAgcDriver.md
PR 18139 docs/dev/debt/libSceAgcDriver.md
PR 18185 docs/dev/debt/libSceAgcDriver.md
PR 18388 docs/dev/debt/libSceAgcDriver.md
PR 18390 docs/dev/debt/libSceAgcDriver.md
PR 18455 docs/dev/debt/libSceAgcDriver.md
PR 18515 docs/dev/debt/libSceAgcDriver.md
PR 19191 docs/dev/debt/libSceAgcDriver.md
PR 19620 docs/dev/debt/libSceAgcDriver.md
PR 19852 docs/dev/debt/libSceAgcDriver.md

@adam25136

Copy link
Copy Markdown
Contributor

GTA V (CUSA00419 01.57) with this PR, on Windows with an RTX 5080, as you asked in #18084: the EQAA message is gone, but the title stops on the same target at a later check in the same decoder: a 4-sample target with one fragment and FAST_CLEAR. Starts of up to 120 s on main a57e435a53 with #16882 (975e93eba4) and #18184 (519fab7e3c) merged locally and three local relinker changes, none of them in this PR (they, and the unwrapped eboot, libc.prx and libSceFios2.prx, are listed in #18084; #18184 takes the place of the local libSceSysmodule change listed there).

GPU NVIDIA GeForce RTX 5080 (10de:2c02), driver 621.14 (32.0.16.2114), Vulkan 1.4.357
Host Windows 10 Pro 22H2 (19045), i9-12900KF, WinLibs GCC 15.2.0 r7, Release
Build Result
without this PR the first flip is presented; the process ends after 37.2 s with GCN color targets with fewer fragments than samples (EQAA) are not implemented
with this PR (b278e7d8de) the first flip is presented; the process ends after 37.4 s with PS4 color target fast clear (CMASK) is not implemented, the check at State.cpp L2233

The target: two more starts, each with a local line (not part of this PR) that prints the target the check refuses: with this PR, before the check above; without it, before main's EQAA check at State.cpp L2197. Each printed one target, the same one, and each ended with the same message as the matching start in the table, which had no such line (after 37.2 and 37.3 s): slot 0, CB_COLOR_INFO 0x0002e828 (FAST_CLEAR and COMPRESSION set), CB_COLOR_ATTRIB 0x000021ce (4 samples, 1 fragment, tile index 14), 1920x1088, at 0x237040000. So the title stops on the same target with and without this PR. It is the case the description names under Unchanged: a one-fragment target with FAST_CLEAR.

Not covered here: whether the title reaches this PR's 2- and 4-fragment path; this PR's tests, which I didn't run; Linux and macOS.

AI-assisted: yes. Claude Code ran the builds and starts, added the local diagnostic lines and drafted this comment; a separate review agent checked it. The results are from the runs on this machine.

puridanish284 pushed a commit to puridanish284/AnyPS5 that referenced this pull request Nov 11, 2026
…clear

Take boykopovar#18176 (PS4 EQAA and one-fragment color targets) as a base: a
one-fragment target is drawn as one sample, so its fast clear is the
single-sample fast clear this branch materializes. With this branch's
decode, a one-fragment target with FAST_CLEAR now takes its CMASK
instead of throwing "PS4 color target fast clear (CMASK) is not
implemented", which Grand Theft Auto V (CUSA00419) hits on a 4-sample
1-fragment target with boykopovar#18176.

- GcnColorTarget.cpp keeps both new cases; the check that a fast-cleared
  one-fragment target throws becomes a check that it takes its CMASK
  and FMASK.
- docs/dev/debt/libSceAgcDriver.md keeps boykopovar#18176's PS4 multisampled
  entry without the one-fragment fast clear among what throws, and this
  branch's fast clear entry for single-sample and one-fragment targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
puridanish284 pushed a commit to puridanish284/AnyPS5 that referenced this pull request Nov 11, 2026
Grand Theft Auto V (CUSA00419) draws to a 4-sample, 1-fragment color
target with FAST_CLEAR and COMPRESSION (CB_COLOR_INFO 0x0002e828,
CB_COLOR_ATTRIB 0x000021ce, 1920x1088), which boykopovar#18176 decodes as one
stored sample and the merged decode now gives its CMASK. Besides code
0, the CMASK of such a target can hold the codes 0xc to 0xf that the
AGC path accepts for a one-fragment target, where the GCN branch of
materializeCmaskClear accepted only all 0 or all 0xff bytes.

It now reads each tile's code as readCmask does: code 0 is a
fast-cleared tile and any other code keeps its texels, with the codes
of a one-fragment target required to be 0xc to 0xf, as on the AGC
path. A CMASK with code 0 on every tile is cleared as before, one with
none keeps its texels, and one with code 0 on only some tiles still
throws, since that needs the GCN CMASK tile order.

GcnFastClearColorTarget adds a 4-sample 1-fragment target cleared under
code 0, kept under code 0xc and refused under code 0x5.

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

Copy link
Copy Markdown
Contributor Author

@adam25136 Thank you, that pins it down, and thanks for checking #18207 too. The target you found is a one-fragment fast clear, which this PR still refuses. #18177 now materializes the fast clears of one-fragment targets on top of this branch: its head 1b91fc8eae includes this PR, and with it your target (CB_COLOR_INFO 0x0002e828, CB_COLOR_ATTRIB 0x000021ce) is cleared when its CMASK has code 0 on every tile and kept when no tile has it. If you can run #18177's head on CUSA00419, it would show whether the title gets past this target.


Generated by Claude Code

@gabichuuuuu

Copy link
Copy Markdown
Contributor

Windows check of head b278e7d8de, merged onto main 28237a8567 (clean merge, built together with other open PRs that touch different files).

Setup: Windows 11 x64, WinLibs GCC 15.2.0 (r7), Ninja, Release, BUILD_TESTING=ON, Python 3.15.

  • Tests built from this PR's test files: agc_driver_gcn_eqaa_color_target, agc_gcn_color_target.
  • All of them pass in 3 of 3 runs.
  • Negative control: with this PR's code reverted to main, the tests do not build (core/libs/prx/libSceAgcDriver/tests/GcnColorTarget.cpp:122:16: error: 'const struct AgcDriver::Graphics::ColorTarget' has no member named 'gcnFmaskBytes'; did you mean 'cmaskBytes'?), which is expected when the tests use interfaces the PR adds or changes.

AI-assisted: yes.

…agment

A CB_COLOR_VIEW of slice n of a GCN color target started n single-sample
slices past CB_COLOR_BASE, and its CMASK and FMASK started at their
bases. A slice holds all stored fragments, as addrlib sizes it with its
samples, and the CB steps the CMASK and FMASK by CB_COLOR_CMASK_SLICE and
CB_COLOR_FMASK_SLICE: Mesa programs all three bases for slice 0 and the
layer only in CB_COLOR_VIEW. Slice n of a multisampled, EQAA or
one-fragment target now starts n slices of its fragments past the base,
and its CMASK and FMASK n of their slices past theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
puridanish284 pushed a commit to puridanish284/AnyPS5 that referenced this pull request Nov 12, 2026
…own CMASK

A fast-cleared single-sample or one-fragment GCN color target viewed at
slice n read and expanded the CMASK of slice 0. With boykopovar#18176's slice
strides merged, the CMASK of slice n starts n CB_COLOR_CMASK_SLICE sizes
past CB_COLOR_CMASK; such a slice is a multiple of 128 bytes, so the GCN
CMASK is now read and written at 128-byte alignment instead of 256.

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

Copy link
Copy Markdown
Contributor

Linux/AMD verification of head b58d7b1f4d0ab34c4ded6ca9c8e9fdafa7a7e19f (pinned, no rebase; force-pushed since the first verify, which ran at b278e7d8de7; headRefOid re-checked 2026-11-12). Environment: Linux x86-64 CachyOS 7.3.1-1-cachyos, AMD Ryzen 7 9800X3D, GCC 16.2.1, CMake 4.4.5, Ninja 1.13.2, Release BUILD_TESTING=ON; clean worktree build (/home/benj/scratch/wt3/pr-18176 → /home/benj/scratch/builds/vfy3-pr-18176), exit 0 (9398 targets, taskset -c 0-11, -j12, TMPDIR=/home/benj/scratch/tmp), re-checked up to date. GPU: AMD Radeon RX 9070 XT (RADV GFX1201), RADV Mesa 26.2.5-arch3.1 (Vulkan 1.4.354), Khronos validation layer 1.4.363 loaded via VK_LAYER_PATH=/tmp/opencode/vvl/pkg/usr/share/vulkan/explicit_layer.d (no "was not found but was requested by env var VK_INSTANCE_LAYERS" in the log). Command: env TMPDIR=/home/benj/scratch/tmp ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LAYER_PATH=/tmp/opencode/vvl/pkg/usr/share/vulkan/explicit_layer.d taskset -c 0-11 ctest --test-dir /home/benj/scratch/builds/vfy3-pr-18176 -R agc_driver -V -j8. Result: 1156/1157 passed (99%), 17 skipped (same platform/feature skip list as on main), 1 failure: agc_driver_tessellation (#1856, SEGFAULT, 0.32 s). The PR's new tests pass: agc_driver_eqaa_color_target (#1412, 0.08 s) and agc_driver_gcn_eqaa_color_target (#1494, 0.07 s). Control on unmodified main @016db0480e4 (same machine, GPU and env, ctest --test-dir /home/benj/scratch/builds/main -R 'agc_driver|pipeline' -j4, 1187 tests): agc_driver_tessellation also SEGFAULTs on main (#1827), so that failure is pre-existing on this RADV host, not PR-caused. (The control also failed agc_driver_frame_replay_rewind_copy #2117 on main while it passed on this PR build — a main-side flake, unrelated to this PR.) 0 VUID- lines in the test log. check_conventions.py --base origin/main: exit 0, "18 findings, 0 errors" — all debt-length warnings in docs/dev/debt/*.md files this PR does not touch (they enter the local diff through the branch's "Merge main into …" commit added by the force-push; the PR's own files — State.hpp, MultisampleTarget.cpp, State.cpp, GcnColorTarget.cpp, tests/execution/GcnEqaaColorTarget.cpp, docs/dev/debt/libSceAgcDriver.md — produce no findings).

@blawesom

Copy link
Copy Markdown
Contributor

Validation run: item 10 of 5-item batch — AGC EQAA / one-fragment color targets

Verdict: ALL GREEN — no regressions detected; tested SHA pushed to blawesom/AnyPS5 as validation/pr-18176.

Environment

  • Machine: CachyOS, kernel 7.3.4-1-cachyos, Ryzen 7 9800X3D
  • GPU: AMD Radeon RX 9070 XT (RADV GFX1201, vendor=0x1002 device=0x7550), selected via ANYPS5_GPU='AMD Radeon RX 9070 XT' (log line: Selected GPU name=AMD Radeon RX 9070 XT (RADV GFX1201)); second GPU AMD Radeon AI PRO R9700 also present, /dev/kfd present
  • Validation layer: VK_LAYER_KHRONOS_validation via VK_ADD_LAYER_PATH=/tmp/opencode/vvl-layer (loader inserted /home/benj/.local/opt/vulkan-validation-layers/usr/lib/libVkLayer_khronos_validation.so, API 1.4.363)
  • Scope: Linux/AMD RADV only; results do not establish Windows/NVIDIA/macOS behavior

SHAs

  • BASE (origin/main): a9f291040088cac6babfbe270c50f344a4f6f27d — reused existing read-only build at /home/benj/scratch/wt5/base-main (HEAD verified, git status --porcelain clean, build/build.ninja present)
  • HEAD (PR feat(agc): draw PS4 EQAA and one-fragment color targets #18176): b58d7b1f4d0ab34c4ded6ca9c8e9fdafa7a7e19f — worktree /home/benj/scratch/wt5/pr-18176, submodules initialized

Build (PR tree, under build lock; lock wait 10 s)

  • cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DBUILD_TESTING=ON → exit 0, wall 59 s
  • cmake --build build --parallel 12 (CMAKE_BUILD_PARALLEL_LEVEL=12, MAKEFLAGS=-j12) → exit 0, wall 1271 s

Focused tests (under build lock; lock wait 0 s)

Pattern (identical matched set of 23 tests in both trees, verified by diffing ctest -N -R output):

agc_(driver_eqaa_color_target|gcn_color_target|gcn_decode|driver_sample_multisample_target|driver_multisample|driver_native_multisample|driver_packed_unorm4444_multisample|driver_cached_image_multisample|driver_sample_mask_multisample|multisample_guest_access|driver_multisampled_pass_order)

Command per tree (each timeout 3600, wall 2 s base / 2 s PR):

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/tmp/opencode/vvl-layer VK_LOADER_DEBUG=layer ANYPS5_GPU='AMD Radeon RX 9070 XT' ctest --test-dir build -R '<pattern>' -V

Results base vs PR head: 23/23 Passed on both, 0 Failed/Skipped; per-test pass/fail identical (no diffs). List: agc_driver_cached_image_multisample_guard, agc_driver_eqaa_color_target, agc_driver_multisample_{centered_lines,fill_host_only,readback,readback_uint8/16/64/128,readback_depth,readback_depth_retile,readback_retile,readback_upload,retirement,srgb_twin}, agc_driver_multisampled_pass_order, agc_driver_native_multisample_depth, agc_driver_packed_unorm4444_multisample_partial_write, agc_driver_sample_mask_multisample, agc_driver_sample_multisample_target, agc_multisample_guest_access, agc_gcn_color_target, agc_gcn_decode.

Supplementary PR-only run (new test added by this PR, not present on base): ctest --test-dir build -R '^agc_driver_gcn_eqaa_color_target$' -V with identical env → Passed (GCN EQAA color target tests passed: 4-sample 2-fragment draws resolve like 4x MSAA (16384 bytes), 102 quarter-coverage channels, FMASK of EQAA and one-fragment targets guarded over the 4096 bytes CB_COLOR_FMASK_SLICE gives).

Layer checks (per AGENTS.md)

  • was not found but was requested by env var VK_INSTANCE_LAYERS: absent in base, PR and extra logs (0 occurrences each)
  • Insert instance layer "VK_LAYER_KHRONOS_validation": present in all three logs (26 in base/PR pattern logs, 1 in extra)

VUID / sync-hazard diff

  • Extracted all VUID-* and SYNC-HAZARD* IDs per test from both logs: zero IDs in base and zero in PR — no new validation errors or sync hazards introduced by the change (also 0 Validation Error/Warning lines in all logs)

Push

  • git push fork +b58d7b1f4d0ab34c4ded6ca9c8e9fdafa7a7e19f:refs/heads/validation/pr-18176 → new branch created on blawesom/AnyPS5

Limitations

  • Single run per tree (no repetition; intermittent faults not excluded), Linux + AMD RADV GFX1201 only
  • The compared pattern matches an identical 23-test set in both trees; the PR-only new test agc_driver_gcn_eqaa_color_target was validated separately on the PR head only (no base counterpart exists)
  • Build-lock protocol shared with 4 other validation items on this machine; lock waits recorded (build 10 s, tests 0 s)

@github-actions github-actions Bot added review queue Next in the maintainer review queue: checks pass, no open change request, no conflict and removed review queue Next in the maintainer review queue: checks pass, no open change request, no conflict labels Nov 14, 2026
@Ricard-Kollcaku

Copy link
Copy Markdown
Contributor

NVIDIA run on Ubuntu 26.04.1 LTS: NVIDIA GeForce RTX 4080 SUPER, driver 595.99.02, Intel Core i9-14900KF, GCC 15.2.0 Release, validation layer 1.4.341. PR head b58d7b1f4d merged onto main 32a2f1e1d7 (git merge --no-ff, clean merge).

main 32a2f1e1d7 this PR
whole ctest suite (5436 tests on main, 5437 with the PR) 0 failed, 61 skipped 0 failed, the same 61 skipped
agc_driver_gcn_eqaa_color_target not in main passed 3/3 alone and once in the suite; each log shows Selected GPU name=NVIDIA GeForce RTX 4080 SUPER and GCN EQAA color target tests passed, none skipped
agc_gcn_color_target passed passed 3/3 alone and once in the suite
the other 28 tests matching the focused pattern (sampled_cache_budget excluded) passed passed, the same 28 tests
VUID- lines / layer not found 0 / 0 0 / 0

agc_driver_native_multisample_depth and agc_driver_sample_mask_multisample ran on the RTX 4080 SUPER with the layer inserted and logged no VUID- line on either side.

Negative control: none: GcnEqaaColorTarget.cpp does not compile against main (error: 'const struct AgcDriver::Graphics::ColorTarget' has no member named 'gcnFmaskBytes', lines 261 and 287).

Command: ANYPS5_GPU="RTX 4080" ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -j 8 --timeout 120 -V

AI-assisted: yes (Claude Code ran the tests and drafted this comment)

@oneandonlydean
oneandonlydean merged commit f27991f into boykopovar:main Nov 14, 2026
15 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 14, 2026
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