Skip to content

fix(agc): draw rect lists in last provoking vertex mode - #7251

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/rect-list-last-provoking-vertex
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/rect-list-last-provoking-vertex

Conversation

@thuanquang

Copy link
Copy Markdown
Contributor

What

TEKKEN DARK RESURRECTION (PPSA31371) aborts right after its controller screen with AGC graphics: last provoking vertex is unsupported for generated primitive pipelines (#7118). The log line before it is a rect-list preparation, and with PROVOKING_VTX_LAST cleared locally the reporter's run got past this stop.

Rect lists are drawn through a generated tessellation control stage that writes the four corners of each rectangle. It gave every corner the flat inputs of the rectangle's first vertex, so ValidateProvokingVertex refused last mode for every rect list.

BuildRectListShaders now also builds a control stage that gives the corners the flat inputs of the rectangle's third vertex, the last of its three, as @MarcZX100 outlined on #7118. A draw whose state asks for the last provoking vertex uses it. When the pixel shader has no flat input the two stages are the same module, so nothing extra is built. Since all four corners carry the same flat values, it doesn't matter which provoking vertex Vulkan picks for the tessellated triangles, as in first mode. The pipeline key already includes the provoking vertex mode, and the new module has its own content identity, so the pipeline cache and the journal keep the two apart.

ValidateProvokingVertex now accepts rect lists in last mode. Its other checks still apply: it still needs VK_EXT_provoking_vertex and still refuses explicit per-vertex flat inputs. The PROVOKING_VTX_LAST debt entry says which vertex is used and that, like the rest of that entry, it is not measured on a console.

Not covered: the title's next stop with the bit cleared, Videodec2: reset required after flushing (#7118), is a separate failure.

Overlaps:

Tested

Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1:

  • agc_driver_provoking_vertex has a new rect-list case. A guest pixel shader with a flat v_interp_mov_f32 P0 input reads a rectangle whose three vertices are red, green and blue. It is drawn in three panels in first, last and first mode, and every checked pixel of the rectangle must be red in first mode and blue in last mode.
    • With ValidateProvokingVertex as on main it fails with the title's message.
    • With the last-vertex control stage built from vertex 0 instead it fails: guest P0 rect list, last provoking vertex: pixel (80, 16) channel 0 is 255, expected 0.
  • agc_driver_graphics:
    • ValidateProvokingVertex accepts a rect list in last mode with a flat pixel input; with the check as on main it fails with the title's message.
    • The rect-list tests check that the last-vertex control stage differs from the first-vertex one exactly when there is a flat parameter, and that both pass ValidateShaders.
  • Full ctest --parallel 4 --timeout 120 on main 5859889b2 with this change (main has since moved to 922dc8999 without touching these files): 1400 tests. Only agc_driver_lds_mixed_width_atomics (agc_* tests: 3 of 483 fail on AMD Radeon RX 6400, pass on NVIDIA RTX 4080 SUPER #5271, fixed by fix(shader): release the LDS lock with an exchange and drop fences inside it #6976) and agc_driver_layered_volume_vertex_no_gpl (AMD Windows: alpha-to-coverage still fails at the original executable path after #6436 #4768) fail, as on main here.
  • python tools/check_conventions.py --base origin/main with this title and body passes.
  • Not tested:
    • the title itself, which I don't have (@cavazzatommaso could rerun);
    • which vertex a PS5 takes for a rectangle;
    • other GPUs, Linux and macOS (CI runs the tests on lavapipe).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: the first stop of TEKKEN DARK RESURRECTION (PPSA31371), AGC: Tekken Dark Resurrection (PPSA31371) aborts on last provoking vertex in a rect-list draw (Windows, RX 7800 XT) #7118
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, Windows 11 26200
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

The generated rect-list control stage gave every corner of a rectangle the
flat inputs of its first vertex, so last mode was refused for rect lists.
BuildRectListShaders now also builds a control stage that takes them from
the rectangle's third vertex when the pixel shader has a flat input, and a
draw in last mode uses it.

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

Copy link
Copy Markdown
Contributor

First NVIDIA + Intel runs, head f2a4236ab, Windows 11, MinGW (WinLibs GCC 15.2.0), Release, serial fresh processes:

  • NVIDIA RTX 3070 (driver 617.42): agc_driver_provoking_vertex (incl. the three-panel first/last/first rect-list case) and agc_driver_graphics pass.
  • Intel UHD 630 (ANYPS5_GPU=UHD, igvk64): both pass.

This is the guard behind the Tekken Dark Resurrection abort in #7118 — last-mode rect lists now draw on three vendor stacks.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6741 docs/dev/debt/libSceAgcDriver.md L104
PR 7207 docs/dev/debt/libSceAgcDriver.md L103-104

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/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 5609 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 5958 core/shader/recompiler/Recompiler.hpp
PR 6130 core/shader/recompiler/SpirvBackend/src/RectListShaders.cpp
PR 6146 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6177 core/shader/recompiler/Recompiler.hpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6222 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/RectListShaders.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6234 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6297 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6320 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6412 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6445 docs/dev/debt/libSceAgcDriver.md
PR 6492 docs/dev/debt/libSceAgcDriver.md
PR 6535 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6563 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6601 docs/dev/debt/libSceAgcDriver.md
PR 6636 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6647 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6783 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6887 docs/dev/debt/libSceAgcDriver.md
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6959 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6965 docs/dev/debt/libSceAgcDriver.md
PR 6973 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6987 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6989 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6995 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 7154 docs/dev/debt/libSceAgcDriver.md
PR 7178 docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/SpirvBackend/src/RectListShaders.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7258 docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for the focused independent GPU run on f2a4236ab. The provoking-vertex and graphics tests pass on both the RTX 3070 and UHD 630, including the first/last/first rect-list fixture. This adds hardware coverage beyond the author’s RX 6700 XT run; it does not establish the PS5’s rectangle provoking-vertex choice, which the PR keeps explicit.

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

Labels

agc libSceAgc* docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants