Skip to content

fix(agc): draw triangle strips through a geometry program with the last provoking vertex - #7883

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/strip-last-provoking-gs
Oct 21, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/strip-last-provoking-gs

Conversation

@thuanquang

@thuanquang thuanquang commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

TEKKEN DARK RESURRECTION (PPSA31371) stops on a draw that feeds a 4-vertex TRIANGLE_STRIP to a geometry program with the last provoking vertex (#7118, capture by @cavazzatommaso):

AGC graphics: last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program

#7374 kept that refusal because nobody knew in which order the hardware hands odd strip triangles to a geometry program in last mode (@MarcZX10 on #7118). I measured that on an AMD RX 6700 XT (gfx1031) (probe source and output), with a Vulkan geometry shader that records the vertex index of each input slot per primitive, with VK_EXT_provoking_vertex set to first and to last:

Input First Last
strip, even triangle i (i, i+1, i+2) (i, i+1, i+2)
strip, odd triangle i (i, i+2, i+1) (i+1, i, i+2)
fan, triangle i (i+1, i+2, 0) (0, i+1, i+2)
  • The geometry shader's ISA (VK_AMD_shader_info) is byte-identical in both modes and for every topology (hashes and the strip dumps). It reads its three inputs from the packed vertex offsets in v0/v1, so the order comes from the fixed-function geometry engine following PROVOKING_VTX_LAST, not from the driver's shader code. These are the same VGPRs the translator fills.
  • The results held for indexed, non-indexed, firstVertex 1 and primitive-restart draws and for 1024-triangle strips. A triangle-list draw gave (3i, 3i+1, 3i+2) in both modes, which validates the probe. The same orders are in Mesa's draw module.

The translator hands a geometry program odd strip triangle i as (i+1, i, i+2) in both modes (InstructionTranslator.cpp, the strip parity select). Since #7374, last mode takes the flat outputs of the program's primitives from their last index, so a last-mode strip now gets the hardware's input order. This change keeps the refusal for fans only: the translator hands them over as (i+1, i+2, 0), and last mode needs (0, i+1, i+2). Strips whose pixel shader reads a vertex slot itself, and explicit per-vertex flat inputs, still throw.

This is RDNA 2 on PC, not the console. The driver also runs these geometry shaders on the legacy (non-NGG) path, while the console runs geometry programs as NGG. On the NGG vertex-shader path, the provoking vertex is v[i] in first mode and v[i+2] in last mode, and back-face culling of strips was exact in both modes. With the winding kept, (i, i+2, i+1) and (i+1, i, i+2) are the only orders that fit, but that is inferred, not read from an NGG geometry shader. The debt entry says the console's order is not measured. First mode also differs: the hardware gives odd strip triangles as (i, i+2, i+1), while the translator gives (i+1, i, i+2). That is a separate fix, which needs the mode in the translator.

The PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LAST debt entry is rewritten gap first and cut from 2825 characters on main to 989. It now lists what is not measured on the console and what still throws.

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.

This head (0bd8f6188a) is one commit on main 2c4b116da9, rebased over #7426, which changed the lines around this change in ValidateProvokingVertex. main's generated-primitive Require is kept as it is now, without !BarycentricPatches(...) (barycentric patches return earlier), and its "strips or fans assembled for a geometry program" refusal is narrowed to fans, as before. The PROVOKING_VTX_LAST debt entry is one combined entry of 1000 characters: this PR's gap-first version plus #7426's statement that the generated barycentric tessellation stages give each corner the last vertex's flat values. On this head:

  • Red, main 2c4b116da9's Pipeline.cpp with this PR's tests: agc_driver_graphics and agc_driver_mesh_provoking_vertex fail with last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program.
  • Green: the five tests below plus feat(agc): draw the last provoking vertex through the barycentric tessellation stages #7426's agc_driver_pixel_barycentric_emulation pass 3 of 3.
  • Khronos validation layer A (main 2c4b116da9) and B (this head), the same six tests: six of six pass on both, with no VUID- line and no was not found but was requested. The only layer output on both is the WARNING-VkImageSubresourceRange-layerCount-compatibility warning described below.

The results below were measured on the previous head dc93cf31e.

  • agc_driver_mesh_provoking_vertex, new strip case: a 4-vertex TRIANGLE_STRIP through the test's pass-through geometry program with a flat input. In last mode, triangle 0 takes vertex 2's colour and triangle 1 takes vertex 3's. In first mode, triangle 0 takes vertex 0's (first-mode triangle 1 is not asserted, see above).

  • agc_driver_graphics (ProvokingVertexTests): in last mode, a strip through a geometry program now validates with no pixel shader, a flat input, a flat P10 input, a smooth input, and the title's four smooth per-vertex inputs. A strip whose pixel shader reads a vertex slot still throws, a fan throws last provoking vertex is unsupported for triangle fans assembled for a geometry program, and both validate in first mode.

  • Red on main with only the test changes: both tests fail with AGC graphics: last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program, the title's message.

  • Negative controls:

    • With the translator changed to give odd strip triangles as (i, i+2, i+1), agc_driver_mesh_provoking_vertex fails with triangle strip, last provoking vertex, triangle 1 (the color of vertex 3): pixel (26, 48) channel 0 is 0, expected 255. The test pins the order.
    • With the whole refusal removed, agc_driver_graphics fails with expected graphics rejection: last provoking vertex is unsupported for triangle fans assembled for a geometry program.
  • Green: agc_driver_graphics, agc_driver_mesh, agc_driver_mesh_provoking_vertex, agc_driver_mesh_provoking_layer and agc_driver_provoking_vertex pass 3 of 3.

  • Khronos validation layer (vulkan-sdk-1.4.363.0), VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V, same RX 6700 XT, on main 38de0a470 (other test files modified locally; none of these tests' sources), on fix(agc): draw triangle strips through a geometry program with the last provoking vertex #7883 59cabc57b and on fix(shader): hand a geometry program strip and fan triangles in the order of its provoking vertex mode #7893 606321886: agc_driver_graphics, agc_driver_mesh, agc_driver_mesh_provoking_vertex, agc_driver_mesh_provoking_layer and agc_driver_provoking_vertex pass on all three. No log reports was not found but was requested or any VUID- error. The layer's only output is the same WARNING-VkImageSubresourceRange-layerCount-compatibility warning in agc_driver_mesh_provoking_layer on all three trees.

  • python tools/check_conventions.py --base origin/main with this title and body passes.

  • Full ctest --parallel 8 --timeout 120 at this head: 1636 tests, 8 fail, none of them a provoking-vertex, mesh or geometry-program test:

  • feat(agc): draw the last provoking vertex through the barycentric tessellation stages #7426 has landed, and this head is rebased over it (above). fix(agc): draw a last provoking vertex that no pixel input sees without the extension #6741 rewrites the same debt entry, so whichever of the two lands second needs a small rebase.

  • In the title (@cavazzatommaso, RX 7800 XT, AMD Windows driver 32.0.31041.1004, this head): TEKKEN DARK RESURRECTION gets past the refusal, plays the intro, renders and runs the mode-select menu, and completes a full fight, then starts the next. The log has no refusal, driver failure or abort.

  • Other GPUs, from reviewers, with main's Pipeline.cpp and this PR's tests as the red side:

    • AMD Radeon 860M (RDNA 3.5) on AMD's Windows driver (@LeandroLP23);
    • AMD RX 9070 XT and Intel UHD 770 on Windows (@savvaniss). The UHD 770 has no mesh shaders, so agc_driver_mesh_provoking_vertex skips there and only agc_driver_graphics is red and green.
    • NVIDIA GeForce RTX 4080 SUPER on Windows, driver 616.92, with this head merged into main cecb540a6 (@simnJS).
  • Not tested: Linux, and the console.

Checklist

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 19, 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 L138
PR 8083 docs/dev/debt/libSceAgcDriver.md L138
PR 8538 docs/dev/debt/libSceAgcDriver.md L138
PR 9084 docs/dev/debt/libSceAgcDriver.md L137-138

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 4449 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7310 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7800 docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8105 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8527 docs/dev/debt/libSceAgcDriver.md
PR 8564 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8672 docs/dev/debt/libSceAgcDriver.md
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md

@LeandroLP23

Copy link
Copy Markdown
Contributor

Windows and AMD's own driver, a second AMD generation. AMD Radeon 860M (RDNA 3.5, 1002:1114), driver 32.0.13058.8001, Windows 11, WinLibs GCC 15.2.0, Release, ANYPS5_NO_SHADER_CACHE=1. Head merged into main b106f6f (clean merge).

Test This head main's Pipeline.cpp, this PR's tests
agc_driver_mesh_provoking_vertex pass, 3 of 3 aborts (0xc0000409): last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program
agc_driver_graphics pass, 3 of 3 fails with the same message

AI-assisted: yes (Claude Code)

@cavazzatommaso

Copy link
Copy Markdown

@thuanquang @MarcZX10 Positive title test for #7118 with this PR at 59cabc57b3e9bfba971a49676f12bdc53fce37db.

TEKKEN DARK RESURRECTION (PPSA31371, v01.000.002) now gets past the previous triangle-strip refusal. In this session:

  • The full intro video played.
  • The main mode-select menu rendered and worked.
  • I completed a full fight, and a subsequent fight started.
  • Pause and return to mode select worked.
  • Rendering, audio and keyboard input worked during the tested session. No physical controller was connected.

There was a several-minute black screen initially. It eventually progressed around the time I pressed a keyboard key, so I cannot distinguish loading/compilation time from waiting for input.

Test environment: Windows 11 Pro 25H2, Radeon RX 7800 XT (16 GB), AMD Windows driver 32.0.31041.1004, MinGW-w64/WinLibs GCC 15.2.0, Release. Temporary diagnostic changes were put aside before checking out the PR and rebuilding the runtime libraries in build-main-fixed. The rebuilt libraries were copied into the existing converted title directory. ANYPS5_NO_SHADER_CACHE=1 was set; the previous capture and forced draw overrides were cleared.

The supplied log has no previous triangle-strip refusal, driver-failure message or SIGABRT. It records shader 0x140793500 being prepared at use, followed by continued runtime activity. Deployed libSceAgcDriver.prx SHA256:

3750d765e9eee6dd59acf9066da8beacff1aab1f880ab547dc7ef15bd99667d6

Remaining observations: the log still contains 3,180 Failed to obtain a video frame. messages, despite visible video playback, and four storage-image warnings about destruction with GPU results pending at the end. There is no recorded exit-code footer, so this does not establish a clean shutdown. I have not tested every mode or longer-term stability.

Full redacted runtime log (ZIP)

All 3,777 log lines are retained. Local Windows paths and the executable name were redacted; guest virtual paths and diagnostic addresses remain.

Test performed on my Windows PC; report preparation and log review were AI-assisted (Codex). Thanks for the fix!

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 19, 2026
@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data: with this PR's test changes, the last-provoking-vertex geometry draws fail on main and pass with the PR, on an AMD RX 9070 XT and an Intel UHD 770.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 59cabc57b merged into main 85029a00f. "Without" means only this PR's diff to tests/Graphics.cpp and tests/execution/MeshProvokingVertex.cpp, applied to main 85029a00f.

Tests, ×3 UHD 770 RX 9070 XT
This head: the 30 tests built from those files 29 pass; agc_driver_mesh_provoking_vertex skips (no mesh shaders on this GPU) 30 of 30 pass
Without agc_driver_graphics fails: last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program; the mesh test skips agc_driver_graphics fails the same way, and agc_driver_mesh_provoking_vertex aborts with that error

AI-assisted: yes (Claude Code)

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@thuanquang

Copy link
Copy Markdown
Contributor Author

@cavazzatommaso thanks for the title run, and @LeandroLP23 and @savvaniss for the runs on the 860M, RX 9070 XT and UHD 770. I've added them to the description.

@github-actions github-actions Bot added the fix error Closes an issue (Fixes #N) label Oct 19, 2026
@thuanquang
thuanquang force-pushed the fix/strip-last-provoking-gs branch from 59cabc5 to dc93cf3 Compare October 20, 2026 08:23
@thuanquang

Copy link
Copy Markdown
Contributor Author

@DavidSamir #6741 and #7426 edit the same PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LAST debt entry that this PR now cuts gap first, and #7426 also changes the ValidateProvokingVertex line next to this PR's. I'm happy for yours to go first. If they land before this one, I'll rebase this and fold what they implement into the shorter entry. If this one lands first, your entry edits should each come down to a clause.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
…st provoking vertex

An RX 6700 XT hands a geometry shader odd strip triangle i as
(i+1, i, i+2) with the last provoking vertex, which is the order the
translator already uses, and since boykopovar#7374 last mode takes the flat
outputs of the program's primitives from their last index. Keep the
last-mode refusal for fans only, which reach the program as
(i+1, i+2, 0) while the hardware gives (0, i+1, i+2). TEKKEN DARK
RESURRECTION (PPSA31371) stops on such a strip draw.

Co-Authored-By: Claude <noreply@anthropic.com>
@thuanquang
thuanquang force-pushed the fix/strip-last-provoking-gs branch from dc93cf3 to 0bd8f61 Compare October 21, 2026 14:59
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@simnJS

simnJS commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

NVIDIA, Windows. GeForce RTX 4080 SUPER, driver 616.92 (32.0.16.1692), Windows 11 Pro 26200, Ryzen 9 7950X3D, WinLibs GCC 15.2.0 r7, Release. Head 0bd8f6188 merged into main cecb540a6 (clean merge). ANYPS5_GPU=NVIDIA, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ctest --repeat until-fail:3 -V. The mesh test logs Selected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 and checks smooth inputs too.

Test This head main's Pipeline.cpp, this PR's tests
agc_driver_mesh_provoking_vertex pass, 3 of 3 (0.5–0.7 s) aborts (0xc0000409): last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program
agc_driver_graphics pass, 3 of 3 (7.8–8.5 s) fails with the same message

Khronos validation layer not run: the Vulkan SDK is not installed on this machine.

AI-assisted: yes

@adriadam10
adriadam10 merged commit d27d05e into boykopovar:main Oct 21, 2026
13 of 14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the rebased head: strips now pass through a geometry program with the last provoking vertex, fans keep the refusal, the strip cases in the mesh and graphics tests fail on main, the debt entry still lists every remaining limit, and the Windows/NVIDIA run from @simnJS passes; merged.

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

Labels

agc libSceAgc* docs fix error Closes an issue (Fixes #N) unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AGC: Tekken Dark Resurrection (PPSA31371) aborts on last provoking vertex in a rect-list draw (Windows, RX 7800 XT)

6 participants