Skip to content

feat(agc): fast clear the CMASK of array and layered color targets - #11825

Open
oneandonlydean wants to merge 13 commits into
boykopovar:mainfrom
oneandonlydean:carry/8065-cmask-array
Open

oneandonlydean wants to merge 13 commits into
boykopovar:mainfrom
oneandonlydean:carry/8065-cmask-array

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

Carried from #8065 by @ArielWolle (closed by the open PR limit, not on its merits).

Fast clears the CMASK of array and layered color targets instead of throwing CMASK fast clears of a 3D or array color target are unsupported. Each layer is cleared through its own CMASK slice: the color address, the CMASK address and the pipe-bank XOR are offset per slice, the CMASK range check covers every layer, and the written-buffer ranges cover all layers. A 3D color target and a slice or array of a mipmapped target still throw, as recorded in the technical debt entry. The per-slice CMASK stride follows Addrlib's slice size and has not been measured on hardware.

The branch is the author's three commits on current main. The layered-draw commits it was stacked on (#7254) are already in main. It still contains the two commits of #7668 (CMASK offset of a color target slice), which is open: if #7668 merges first they apply as empty, and if this merges first #7668 has nothing left to add.

Two commits of ours: a merge of main, and one that moves the pipeline journal's sizeof(State) guard from 912 to 928 bytes, because ColorTarget gained cmaskSlice and cmaskSliceBytes. Both only address a draw's CMASK data; the recipe codec and CanonicalPipelineState copy just the pipeline-relevant color target fields, so no recipe format changes.

Tested

  • Linux, Intel i9-14900KF, NVIDIA GeForce RTX 4090 (driver 610.57.04), on the head merged with main 12686b5: agc_driver_graphics, agc_driver_cmask_fast_clear, agc_driver_layered_array_color_draw, agc_recorder_cmask and agc_driver_graphics_maps_fallback pass. tools/check_conventions.py with this title and body passed. A full local CI run (cilocal.py ci: configure, build, libs, select_tests.py ctest) on the head ran 2517 tests with 0 failures and 0 errors; 29 were skipped, among them pad_sdl, which skips because this host has a joystick attached (its own message: "SDL sees 1 host joysticks"), so the run's skip check flags it. Not run: Windows, macOS.
  • The author's own run, on Windows 11 (MinGW Release, RTX 3070): the same graphics, CMASK and layered array tests passed.
  • The title that stopped at this error (PPSA34063 NHL 27 (PPSA34063) on Windows / AMD RX 6700 XT: reaches match loading, ~1.3 FPS #4275) has not been run with this change by us.

Checklist

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 27, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 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/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
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/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9289 docs/dev/debt/libSceAgcDriver.md
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10351 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 11452 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11587 docs/dev/debt/libSceAgcDriver.md
PR 12792 docs/dev/debt/libSceAgcDriver.md
PR 12904 docs/dev/debt/libSceAgcDriver.md
PR 13147 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/CmaskFastClear.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14964 docs/dev/debt/libSceAgcDriver.md
PR 15136 docs/dev/debt/libSceAgcDriver.md
PR 15343 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 15456 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 15529 docs/dev/debt/libSceAgcDriver.md
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16260 docs/dev/debt/libSceAgcDriver.md
PR 16427 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
docs/dev/debt/libSceAgcDriver.md
PR 16879 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 16935 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17022 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
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/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17943 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 18029 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 18082 docs/dev/debt/libSceAgcDriver.md
PR 18177 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 19610 docs/dev/debt/libSceAgcDriver.md
PR 19620 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 19821 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 19852 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.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
docs/dev/debt/libSceAgcDriver.md
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 20153 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 20518 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 20519 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 20728 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 21923 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 21948 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22025 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22062 docs/dev/debt/libSceAgcDriver.md
PR 22140 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 22251 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22328 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 22434 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22514 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 22546 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 22692 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22697 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.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 23553 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 23811 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23818 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
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/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24327 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24572 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 24735 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25489 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25534 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25557 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25684 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 26036 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 26040 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26041 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 26084 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26630 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26691 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 26802 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27672 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27688 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 27698 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27807 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 27966 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 27979 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28059 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28077 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28090 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 28118 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28142 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28150 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28166 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28176 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28186 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28193 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28197 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28198 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28209 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28229 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28250 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28292 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 28311 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28350 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28372 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28384 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28396 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28400 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28411 core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28470 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28487 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28488 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28492 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28496 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28520 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28522 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28523 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28564 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28586 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28590 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28605 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28660 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28673 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 28808 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28870 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/tests/ColorTargetLayout.cpp
PR 28875 core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 28920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28925 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28928 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28930 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28934 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28936 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28945 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28948 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 28956 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29032 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29033 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29042 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29051 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29058 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29060 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29066 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29067 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29069 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29070 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 29072 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 29076 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29084 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29085 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29086 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29087 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29089 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29090 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29091 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29095 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 29096 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29097 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29098 core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29101 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29102 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29103 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29104 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29105 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29106 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29107 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29108 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
PR 29110 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29113 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29115 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29116 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29117 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29118 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29119 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29120 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29121 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29123 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29200 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 29218 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 29280 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

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

I reviewed the per-slice CMASK address path, the CPU materialization loop, and the added layout/graphics tests. The Windows product job passes, as do conventions, eligibility, intake, labels, and the progress report. The author reports focused GPU runs and a 2,517-test Linux suite; I could not run those locally because this environment has no usable GPU runtime.

Before approval, the required AGC validation from CONTRIBUTING is still missing from the report: run the same focused tests on main and this change, on the same GPU/machine, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1 under ctest -V; confirm the requested layer was found and compare any VUID- errors. The current PR body reports results on the change but does not include that paired validation-layer run.

The branch is also based on 5bc84038c490a0427ff272e39e2a1cdf6fdc3c0e, while current upstream main is 801d5b9bc11049e6274daca09d70690bd5b8d0a9. Please update and retest against current main. Finally, the body says this branch includes two commits from still-open #7668 and that either PR could land first; please get the overlapping authors' agreement on landing order and record the dependency accordingly, as CONTRIBUTING requires. I request changes for these validation/readiness gaps, not because I found a confirmed CMASK calculation defect.

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 27, 2026
@ycbuzi

ycbuzi commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Windows run of 6e05e5763e merged onto main d13b3d7c55 (5b4ab8d229, clean). Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. One GPU at a time with ANYPS5_GPU, plus ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, ctest -V --repeat until-fail:2. Each log's Selected GPU line names its device.

device 37 tests of agc_driver_cmask_fast_clear_tests, agc_driver_layered_array_color_draw_tests and agc_driver_graphics_tests
GeForce RTX 4070 SUPER (0x2783), NVIDIA 616.92 all pass, both runs
GeForce GTX 1650 SUPER (0x2187), NVIDIA 616.92 all pass, both runs
AMD Radeon(TM) Graphics (1002:164e), AMD 32.0.21030.2001 all pass, both runs
  • The build has no errors. Its only warnings are main's two PipelineLibrary.cpp __builtin_memcmp ones.
  • No runnable negative control: with main's versions of the production files, the tests don't compile (CmaskLayout::Nibble with three arguments and ColorTarget::cmaskSliceBytes are new).
  • agc_driver_graphics_tests opens no device, so its part is CPU-side on every row.

AI-assisted: yes (Claude Code)

@XairRrR XairRrR 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 — changes requested

The decode, stride and per-layer split work and the focused tests pass on a clean merge, but the CPU fast-clear path writes the cleared tiles of every slice except slice 0 to the wrong texels, because it drops the slice's pipe-bank XOR.

What I ran

  • PR head: 6e05e5763ebeaab817ad3baca00de8d3c44ac8a6
  • main: 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7
  • Merged tree (main + head, --no-ff, no conflicts): 7b90366b84d107024ba9429f2cbfc408630b2dd7
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja, in a clean worktree.
git fetch origin main pull/11825/head:refs/review/11825
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/11825
git diff --check origin/main...refs/review/11825
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_cmask_fast_clear_tests agc_driver_layered_array_color_draw_tests agc_driver_recorder_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -R '^(agc_driver_graphics|agc_driver_cmask_fast_clear|agc_driver_layered_array_color_draw|agc_recorder_cmask|agc_driver_graphics_maps_fallback)$' -V --output-on-failure
# the same build and ctest command on origin/main, then back to the merged tree
# probe (local only, not pushed): one 8x8 scissored draw vs one CMASK-cleared tile per slice, see Findings

Results

Check Result
Merge into main clean
git diff --check clean
check_conventions.py 0 errors, 1 warning: [debt-length] on the CMASK fast clears entry (2586 characters; it was 1554 on main)
Build of the four test targets OK
Focused tests, merged tree, validation layer on 5/5 pass
Focused tests, main, validation layer on 5/5 pass
VUID- lines (merged / main) 0 / 0
was not found but was requested by env var VK_INSTANCE_LAYERS absent in both logs; the loader inserted VK_LAYER_KHRONOS_validation in both
Test duration each test under 6 s
Probe: CPU-cleared tile vs drawn tile, slices 1 to 3 different texels (see Blocking)
Merged tree ctest
1/5 Test  #840: agc_recorder_cmask ....................   Passed    0.21 sec
2/5 Test  #948: agc_driver_graphics ...................   Passed    4.64 sec
3/5 Test  #951: agc_driver_cmask_fast_clear ...........   Passed    0.45 sec
4/5 Test #1221: agc_driver_layered_array_color_draw ...   Passed    0.48 sec
5/5 Test #1589: agc_driver_graphics_maps_fallback .....   Passed    5.51 sec
100% tests passed out of 5
1221: [src/VulkanDevice.cpp:1288 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 4070 Ti SUPER vendor=0x10de device=0x2705 subgroup=32
840: [Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
main ctest
1/5 Test  #840: agc_recorder_cmask ....................   Passed    0.20 sec
2/5 Test  #948: agc_driver_graphics ...................   Passed    4.54 sec
3/5 Test  #951: agc_driver_cmask_fast_clear ...........   Passed    0.38 sec
4/5 Test #1221: agc_driver_layered_array_color_draw ...   Passed    0.35 sec
5/5 Test #1589: agc_driver_graphics_maps_fallback .....   Passed    4.81 sec

This is the paired validation-layer run that the earlier review asked for (that review was on 45e34f8cd6). It shows no VUID- lines on either side. That review's base-branch point is also settled: the head merges cleanly onto the current main.

Negative control

Restoring every production file from main doesn't compile, because the tests use Nibble's third argument and ColorTarget::cmaskSliceBytes. ycbuzi's Windows run reported the same. Instead, I reverted one production behaviour at a time and kept the tests:

Reverted Test Result
materializeCmaskClear always calls materializeCmaskClearOf once (no per-layer split) agc_driver_layered_array_color_draw_tests fails: "the second layer (slice 1) of the two-layer view holds 0 cleared texels", same for slices 1 and 2
CmaskLayout::Nibble ignores slice agc_driver_graphics_tests fails: "CMASK nibble of a slice differs from addrlib's"
cmaskSliceOffset forced to 0 in DecodeColorBuffer agc_driver_graphics_tests fails: "slice 1 of a 2D array fast-clear target did not decode at its own CMASK block"

None of these tests catches the bug below.

Findings

Blocking

1. A partial CMASK clear of slice ≥ 1 writes the clear value into the wrong 8x8 tiles.

storeCmaskClearTexels (core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:443) builds its layout as ColorTargetLayout(width, height, tileMode, elementBytes), so pipeBankXor falls back to its default of 0. The change computes each slice's XOR, in materializeCmaskClear (one.pipeBankXor ^= ColorSliceXor(...), Draw.cpp:526) and for a plain slice in DecodeColorBuffer. The CPU path never reads that value. storeSingleTexels does pass color.pipeBankXor (Draw.cpp:319).

An array resident has more than one layer, so StorageTexture::ElementView() returns VK_NULL_HANDLE for it and the GPU recordCmaskClear path is never taken. Every array or layered fast clear therefore goes through this CPU path. When the CMASK is fully cleared the error doesn't show, because the whole slice is filled. When it is partly cleared, the clear lands on other texels of the slice than the cleared tiles.

The new RunCmaskClear test can't see this. It compares the two-layer view with the single-slice view of the same slice (LayeredArrayColorDraw.cpp L280-L288), and both go through the same CPU path. It also checks only the number of cleared texels, not where they are.

Evidence: I added a probe to the test locally. For each slice of the four-slice SW_64KB_R_X array, it (a) draws through a single-slice view with the scissor limited to one 8x8 tile and records which 32-bit words of the slice change, then (b) marks only that tile cleared in the slice's CMASK, runs the fast-clear materialization through the same single-slice view, and records which words change.

PROBE slice 0 tile (5,3): drawn 64 words first 1664, cleared 64 words first 1664, same=1
PROBE slice 0 tile (0,0): drawn 64 words first 0, cleared 64 words first 0, same=1
PROBE slice 1 tile (5,3): drawn 64 words first 17536, cleared 64 words first 18048, same=0
PROBE slice 1 tile (0,0): drawn 64 words first 16896, cleared 64 words first 16384, same=0
PROBE slice 2 tile (5,3): drawn 64 words first 34688, cleared 64 words first 34432, same=0
PROBE slice 2 tile (0,0): drawn 64 words first 33024, cleared 64 words first 32768, same=0
PROBE slice 3 tile (5,3): drawn 64 words first 50560, cleared 64 words first 50816, same=0
PROBE slice 3 tile (0,0): drawn 64 words first 49920, cleared 64 words first 49152, same=0

With the one-line fix below, every row prints same=1. The PR's agc_driver_layered_array_color_draw and agc_driver_cmask_fast_clear tests still pass with that fix.

-    const ColorTargetLayout surface(color.extent.width, color.extent.height, color.tileMode, color.elementBytes);
+    const ColorTargetLayout surface(color.extent.width, color.extent.height, color.tileMode, color.elementBytes, color.pipeBankXor);

Suggested fix: pass color.pipeBankXor as above. Also extend RunCmaskClear (or agc_driver_cmask_fast_clear with a real slice XOR) to compare the cleared texels against where a draw writes the same tile, or against ColorTargetLayout(..., pipeBankXor).Offset(x, y), so that the test fails without the fix. The fix also covers the CPU fallback for a plain slice (arrayLastSlice == 0, slice ≠ 0), which this PR (with #7668's commits) newly lets through, and a non-zero base XOR taken from the surface address.

Probe added to LayeredArrayColorDraw.cpp (local only)
VkRect2D ProbeScissor{{0, 0}, {0, 0}};
bool ProbeOn = false;
// in Draw(): state.scissor = ProbeOn ? ProbeScissor : coverNothing ? VkRect2D{{0, 0}, {0, 0}} : VkRect2D{{0, 0}, {Side, Side}};

void Probe(AgcDriver::VulkanDevice& device, std::uint8_t* texels, std::uint32_t slice, std::uint32_t tx, std::uint32_t ty) {
    using AgcDriver::Graphics::CmaskLayout;
    const auto surface = AddressOf(texels);
    const auto words = SliceBytes / 4u;
    std::fill_n(reinterpret_cast<std::uint32_t*>(texels), SurfaceBytes / 4u, Kept);
    AgcDriver::GuestMemory::CollectWrites(surface, SurfaceBytes);
    AgcDriver::GuestMemory::BumpCollectEpoch();
    ProbeOn = true;
    ProbeScissor = {{static_cast<std::int32_t>(tx * 8), static_cast<std::int32_t>(ty * 8)}, {8, 8}};
    Draw(device, DecodeColor(surface, Slices - 1u, slice, 1), 1, false);
    ProbeOn = false;
    AgcDriver::Graphics::StorageTexture::FlushPending(surface, SurfaceBytes, nullptr, "probe draw");
    device.WaitIdle();
    std::vector<std::size_t> drawn;
    const auto* w = reinterpret_cast<const std::uint32_t*>(texels);
    for (std::size_t i = slice * words; i < (slice + 1) * words; ++i) if (w[i] != Kept) drawn.push_back(i);
    const CmaskLayout cmaskLayout(Side, Side);
    std::vector<std::byte> mask(Cmask.size(), std::byte{0xff});
    const auto nibble = cmaskLayout.Nibble(tx, ty, slice);
    mask[slice * CmaskSliceBytes + nibble / 2u] &= std::byte{static_cast<std::uint8_t>((nibble % 2u) == 0 ? 0xf0u : 0x0fu)};
    std::fill_n(reinterpret_cast<std::uint32_t*>(texels), SurfaceBytes / 4u, Kept);
    {
        std::lock_guard lock(AgcDriver::GuestMemory::GpuMutex());
        AgcDriver::GuestMemory::Write(AddressOf(Cmask.data()), mask);
    }
    AgcDriver::GuestMemory::CollectWrites(surface, SurfaceBytes);
    AgcDriver::GuestMemory::BumpCollectEpoch();
    Draw(device, DecodeColor(surface, Slices - 1u, slice, 1, true), 1, true);
    AgcDriver::Graphics::StorageTexture::FlushPending(surface, SurfaceBytes, nullptr, "probe clear");
    device.WaitIdle();
    std::vector<std::size_t> cleared;
    for (std::size_t i = slice * words; i < (slice + 1) * words; ++i) if (w[i] != Kept) cleared.push_back(i);
    std::printf("PROBE slice %u tile (%u,%u): drawn %zu words first %zu, cleared %zu words first %zu, same=%d\n", slice, tx, ty, drawn.size(), drawn.empty() ? 0 : drawn[0], cleared.size(), cleared.empty() ? 0 : cleared[0], drawn == cleared ? 1 : 0);
}
// in main(): for (const std::uint32_t sl : {0u, 1u, 2u, 3u}) { Probe(*device, array.Data(), sl, 5, 3); Probe(*device, array.Data(), sl, 0, 0); }

Non-blocking

2. The one-fragment CMASK code check still reads the slice-0 nibbles. In readCmask, the coverageSamples > samples loop (core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:417, permalink) still calls layout.Nibble(tileX, tileY), while the loop below it now passes color.cmaskSlice. For slice ≥ 1 of a single-sample, multi-coverage target, it checks the codes at the slice-0 positions. On a small target those can be padding nibbles, so it can throw on leftover values or miss a real code. Pass color.cmaskSlice there too.

3. Debt entry length. check_conventions.py warns that the CMASK fast clears entry in docs/dev/debt/libSceAgcDriver.md is 2586 characters, over the 1000-character guideline; it was already 1554 on main. The new text could be shortened to the gap: the per-slice stride and Z-bit XOR follow Addrlib and are not verified on hardware, and a 3D target or a slice or array of a mipmapped target throws.

4. Landing order with #7668. The body lists #7668 under Depends on, and that PR is still open. The fix for finding 1 also applies to the plain-slice CPU path that #7668's commits enable, so whichever PR lands first should carry it.

Not verified

  • The CMASK slice stride and the Z0..Z3 XOR against PS5 hardware. Like the debt entry, I compared only the code with the Addrlib references in the tests.
  • The PPSA34063 title (discussion #4275); I did not launch any title.
  • Windows and other GPUs. I ran only the GPU named above.
  • The full test suite and the libs target. I built and ran only the AGC targets the change touches.

To get this to a good state

  1. Pass color.pipeBankXor to the ColorTargetLayout in storeCmaskClearTexels.
  2. Add a test that fails without that fix: a partial CMASK clear of slice ≥ 1 of an XOR-swizzled target, with the cleared texels checked against where a draw of the same tile lands, or against ColorTargetLayout(..., pipeBankXor).Offset.
  3. Optionally, pass color.cmaskSlice in the one-fragment code check and shorten the debt entry.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
ArielWolle and others added 6 commits October 30, 2026 09:31
A view that selects slice N of a single-mip 2D color target moved the
color address by N slices but kept the CMASK register's address, and a
CMASK fast clear of such a slice threw. The CMASK of slice N now sits N
whole-slice CMASKs after the register. 3D targets, targets with an array
depth and slices of mipmapped targets still throw.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AMD Addrlib's HwlComputeCmaskAddrFromCoord passes the slice into the
swizzle pattern as its Z coordinate as well as stepping by sliceSize.
The pipe-aligned 16-pipe pattern puts Z0..Z3 into nibble bits 12, 11,
10 and 9, so a slice moves its tiles inside its own block. A uniform
CMASK reads the same at every slice, but a mixed one was read at the
slice 0 nibbles.

CmaskLayout::Nibble takes the slice, ColorTarget carries it as
cmaskSlice, and the CMASK clear shader gets it as a push constant, so
the CPU and GPU paths agree. The tests pin nibbles evaluated from the
Mesa mesa-25.2.0 pattern text and clear partial CMASKs of slices 1, 2,
3 and 8 on the device.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clear every layer of an array or layered color target through its own
CMASK slice, offsetting the color address, the CMASK address and the
pipe-bank XOR per slice, and widen the written ranges to cover all layers.
The per-slice CMASK stride follows Addrlib's slice size; it has not been
measured on hardware.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… fields

ColorTarget gained cmaskSlice and cmaskSliceBytes (16 bytes) and State holds
one ColorTarget. Both only address the CMASK data of a draw: the recipe codec
and CanonicalPipelineState keep copying just the pipeline-relevant color
target fields, so the layout guard moves from 912 to 928 and no recipe
format changes.
…rray view

materializeCmaskClear moved the CMASK address per layer but left cmaskSlice at
the view's first slice, so readCmask and the CmaskClear shader decoded layers
after the first with that slice's swizzle and cleared other tiles than the
CMASK names. Each layer now decodes with its own slice, and a multisampled
array or layered target keeps being refused on this path.

A two-layer view must clear its second layer as the single-slice view of
that slice does; the new case fails without the fix. The test that pinned a
refusal of a valid mipmapped slice is dropped; the limitation and its debt
entry stay.
Main ran the single-view body for a multisampled color view with an array
range and a CMASK in the EliminateFastClear and DccDecompress passes, and the
Require added with the per-layer loop aborted it. A multisampled view takes
the single-view path again; its CMASK has no per-slice offset, as the decode
keeps cmaskSliceOffset and cmaskSlice at 0 for samples > 1.
@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

Rebased onto main: the four layered 2D array color view commits are already on main as #7254, so they are dropped; the six CMASK commits are replayed with their authors, and the pipeline journal State size guard is updated for the added slice fields.
The agc_ tests pass on the rebased head (1101 passed, 10 skipped as unsupported on the test GPU, 0 failed); the debt entry for the AMD CMASK clear pass stays removed as on main.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head e6aa2ed merged onto main f6fddd6 · tested 2026-10-30 04:10 UTC · 27 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,262 passed · 3 failed (0 new, 2 also fail on main, 1 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,306 of 2,950 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (862 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 69.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_submit_progress: failed in 5 of the last 7 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_job_manager_compute_capacity: Failed in the parallel run; also passed only on retry in 74 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 391 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (391 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_array_layer_target_cpu, agc_driver_bda_span_reads_draw_pipeline, and 383 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin e6aa2edc2a1b406de6172ea4df6271154f4a3802 f6fddd60d826831f70f7c62e25423610ee742bcc
git checkout f6fddd60d826831f70f7c62e25423610ee742bcc && git merge --no-ff e6aa2edc2a1b406de6172ea4df6271154f4a3802
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@XairRrR thank you, you were right: the CPU fast-clear store dropped the slice's pipe-bank XOR, so for slices 1 and up the cleared tile landed on the wrong texels, and my earlier rebase note did not answer it.

What changed (commits a01df99, c5b40a5, 86a4136, on top of e6aa2ed):

  • storeCmaskClearTexels (Draw.cpp:443) now builds its layout with the target's pipeBankXor, the same as storeSingleTexels does. A single-slice view already carries its slice XOR from DecodeColorBuffer, and a layered view gets its per-layer XOR in materializeCmaskClear, so each tile is XORed once.
  • Your second item is done too: the one-fragment check in readCmask now passes color.cmaskSlice to Nibble.
  • New test RunTileClearMatchesDraw in LayeredArrayColorDraw.cpp, your probe made permanent: for slices 0 to 3 and tiles (5,3) and (0,0) it compares the words an 8x8 scissored draw writes with the words a fast clear of the same tile writes. On an RTX 4090 with only the Draw.cpp change reverted, 6 of the 8 cases differ (all of slices 1 to 3; slice 0 is the control and passes); with the change, 0 differ. The five focused tests pass, with no VUID- lines.
  • The CMASK fast clears debt entry is shortened to under 1000 characters; it still lists what is unverified on hardware and what throws.

Could you take another look when you have time?

@TechLevelZero

TechLevelZero commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 86a4136 merged onto main 3741ca9 · tested 2026-11-01 10:34 UTC · 34 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,423 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 44 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,472 of 3,121 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 65.2 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 35.9 s, ⚠️ agc_driver_graphics_maps_fallback 35.5 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 1 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 480 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (480 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 472 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (44)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_f
Reproduce
git fetch origin 86a4136de4bf9a24ac7b6f1a15c37845c3e543c5 3741ca9327246d0df81638726a986cef862b6db5
git checkout 3741ca9327246d0df81638726a986cef862b6db5 && git merge --no-ff 86a4136de4bf9a24ac7b6f1a15c37845c3e543c5
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean dismissed XairRrR’s stale review November 1, 2026 07:28

The slice>0 pipe-bank XOR finding is fixed in a01df99 (Draw.cpp now passes color.pipeBankXor, no double XOR), and your probe is now a permanent test (agc_driver_layered_array_color_draw, red without the fix for slices 1-3). Exact-head CI is green on 86a4136. Dismissing as addressed; please re-review if you see anything else.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026

@XairRrR XairRrR 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 — changes requested

This pull request does not merge cleanly into main (128b5c4): head 86a4136 conflicts in

  • core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp

Please rebase it onto current main. I will review the change once it merges cleanly.

Retain the array-slice push constant with the resolved Vulkan dispatch calls.

@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 review covered the changed implementation and tests, and no verified blocking defect was found.

What I ran

Reviewed head ca2b7cc278ea7c1cae3737a5799e1da182f21393 using repo_read.py against the prepared diff and repository files. No commands or tests were run during this review; test results in the PR description are author-reported.

Results

Check Result Note
Changed code review passed Read the changed implementation and test files listed below.
Automated tests not run The description reports a Linux CI run and an author-reported Windows run.
Physical console behavior not run The description says the slice stride has not been measured on hardware.

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full text of core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded from the review folder due to size; I read the changed test region through repo_read.py. No tests were run. Windows, macOS, and physical-console behavior were not verified in this review. Other excluded files listed in review/manifest.json were not present; the manifest lists only Graphics.cpp as excluded by size.

Files read: core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp, core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp, core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp, core/libs/prx/libSceAgcDriver/Graphics/shaders/CmaskClear.comp, core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp, core/libs/prx/libSceAgcDriver/tests/CmaskFastClear.cpp, core/libs/prx/libSceAgcDriver/tests/ColorTargetLayout.cpp, the changed region of core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, core/libs/prx/libSceAgcDriver/tests/execution/LayeredArrayColorDraw.cpp, and docs/dev/debt/libSceAgcDriver.md.

To get this to a good state

Nothing is required.

@birdmarty

birdmarty commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Tested on Forza Horizon 5 (PPSA22327 01.685.672), where this fixes a stop we hit.

Windows 11 Pro (build 26300), i9-9900K, RX 6800 (AMD 26.10.1, Vulkan 1.4.315), MinGW GCC 15.3.0 Release. Head ca2b7cc (which carries #7668).

  • Without this PR: entering gameplay stopped at CMASK fast clears of a 3D or array color target are unsupported. A diagnostic showed a 6-layer 32x32 array target (slice=0..5 arrLast=5 mip=0/0) with its CMASK fully expanded. fix(agc): offset the CMASK of a plain color target slice by its slice #7668 alone still refused it, because it is an array, not one slice.
  • With this PR: that stop is gone, and it did not come back in any of the 90 later runs, all with this PR in the stack.
  • On the head: check_conventions passes, and there is no debt_fold.py on its base. Its tests could not run on the head as it is: its base is old enough that the test programs did not load against the libraries this checkout builds (0xc0000139). Merged into the game's stack on a newer main, agc_driver_cmask_fast_clear, agc_driver_layered_array_color_draw and agc_driver_graphics passed with the validation layer: 3/3, 0 VUID- lines.
  • In our stack this PR sits on top of fix(agc): import undrawn R_X DCC textures and their colour-target state #21479, and the two conflict in Draw.cpp, State.cpp, PipelineJournal.cpp and LayeredArrayColorDraw.cpp. I resolved it by taking this PR's side: ColorSliceXor and the array check that allows CMASK. The sizeof(State) assert became 1024 for the combined struct. The game results above are with that merge.

With this and the other open PRs listed in #25152, the game now gets through the title screen and menus into the start of the intro.

So it fixes the array case this game uses.

Not done: other GPUs, Linux, console comparison.

AI-assisted: yes (Claude Code).

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The trial merge conflicts in draw/state tracking, the pipeline journal and layered-array test code. The slice-relative color offset and CMASK nibble/XOR selection need the same nonzero base-layer test. Please retain a view starting after slice zero and check that both neighboring slices keep their original color and metadata after eliminate. Please put the direct AGC debt edit in a fragment. I have no paired Vulkan result for this conflicted head.

AI-assisted: yes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs needs rebase Conflicts with main, rebase needed 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