fix(agc): draw triangle strips through a geometry program with the last provoking vertex #7883
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7883"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T12:22:09Z.
What
TEKKEN DARK RESURRECTION (PPSA31371) stops on a draw that feeds a 4-vertex
TRIANGLE_STRIPto a geometry program with the last provoking vertex (#7118, capture by @cavazzatommaso):#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_vertexset to first and to last: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 followingPROVOKING_VTX_LAST, not from the driver's shader code. These are the same VGPRs the translator fills.firstVertex1 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 stripparityselect). 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_LASTdebt entry is rewritten gap first and cut from 2825 characters onmainto 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 onmain2c4b116da9, rebased over #7426, which changed the lines around this change inValidateProvokingVertex.main's generated-primitiveRequireis 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. ThePROVOKING_VTX_LASTdebt 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:main2c4b116da9'sPipeline.cppwith this PR's tests:agc_driver_graphicsandagc_driver_mesh_provoking_vertexfail withlast provoking vertex is unsupported for triangle strips or fans assembled for a geometry program.agc_driver_pixel_barycentric_emulationpass 3 of 3.main2c4b116da9) and B (this head), the same six tests: six of six pass on both, with noVUID-line and nowas not found but was requested. The only layer output on both is theWARNING-VkImageSubresourceRange-layerCount-compatibilitywarning described below.The results below were measured on the previous head
dc93cf31e.agc_driver_mesh_provoking_vertex, new strip case: a 4-vertexTRIANGLE_STRIPthrough 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 throwslast provoking vertex is unsupported for triangle fans assembled for a geometry program, and both validate in first mode.Red on
mainwith only the test changes: both tests fail withAGC graphics: last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program, the title's message.Negative controls:
agc_driver_mesh_provoking_vertexfails withtriangle 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.agc_driver_graphicsfails withexpected 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_layerandagc_driver_provoking_vertexpass 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, onmain38de0a470(other test files modified locally; none of these tests' sources), on #788359cabc57band on #7893606321886:agc_driver_graphics,agc_driver_mesh,agc_driver_mesh_provoking_vertex,agc_driver_mesh_provoking_layerandagc_driver_provoking_vertexpass on all three. No log reportswas not found but was requestedor anyVUID-error. The layer's only output is the sameWARNING-VkImageSubresourceRange-layerCount-compatibilitywarning inagc_driver_mesh_provoking_layeron all three trees.python tools/check_conventions.py --base origin/mainwith this title and body passes.Full
ctest --parallel 8 --timeout 120at this head: 1636 tests, 8 fail, none of them a provoking-vertex, mesh or geometry-program test:mainhas on this card (agc_driver_lds_mixed_width_atomics#6976,agc_driver_lds_lock_budget#7344,agc_driver_layered_volume_vertex_no_gpl#4768);agc_driver_draw_cache_reuse_offandagc_driver_stencil_replay_no_gpl, which lose the device under their usual names and pass from renamed copies (AMD's per-executable pipeline cache, as in #4768);agc_trimmed_import, which fails the same way onmainhere (#6499);log_macrosandlog_macros_timestamps, which fail only in this local build because ccache's base directory turns__FILE__into a relative path with backslashes.#7426 has landed, and this head is rebased over it (above). #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'sPipeline.cppand this PR's tests as the red side:agc_driver_mesh_provoking_vertexskips there and onlyagc_driver_graphicsis red and green.maincecb540a6(@simnJS).Not tested: Linux, and the console.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T12:31:29Z.
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.
main)docs/dev/debt/libSceAgcDriver.mdL138docs/dev/debt/libSceAgcDriver.mdL138docs/dev/debt/libSceAgcDriver.mdL138docs/dev/debt/libSceAgcDriver.mdL137-138Some 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.
core/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-19T12:33:00Z.
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 intomainb106f6f8c(clean merge).main'sPipeline.cpp, this PR's testsagc_driver_mesh_provoking_vertex0xc0000409):last provoking vertex is unsupported for triangle strips or fans assembled for a geometry programagc_driver_graphicsAI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by cavazzatommaso on 2026-10-19T13:25:37Z.
@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:
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 inbuild-main-fixed. The rebuilt libraries were copied into the existing converted title directory.ANYPS5_NO_SHADER_CACHE=1was 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
0x140793500being prepared at use, followed by continued runtime activity. DeployedlibSceAgcDriver.prxSHA256: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!
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T14:11:24Z.
Intel and AMD Windows data: with this PR's test changes, the last-provoking-vertex geometry draws fail on
mainand 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, withVkCacheemptied first. This head59cabc57bmerged intomain85029a00f. "Without" means only this PR's diff totests/Graphics.cppandtests/execution/MeshProvokingVertex.cpp, applied tomain85029a00f.agc_driver_mesh_provoking_vertexskips (no mesh shaders on this GPU)agc_driver_graphicsfails:last provoking vertex is unsupported for triangle strips or fans assembled for a geometry program; the mesh test skipsagc_driver_graphicsfails the same way, andagc_driver_mesh_provoking_vertexaborts with that errorAI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T19:23:10Z.
@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.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T18:11:42Z.
@DavidSamir #6741 and #7426 edit the same
PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LASTdebt entry that this PR now cuts gap first, and #7426 also changes theValidateProvokingVertexline 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.Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-10-21T15:47:51Z.
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
0bd8f6188merged intomaincecb540a6(clean merge).ANYPS5_GPU=NVIDIA,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ctest --repeat until-fail:3 -V. The mesh test logsSelected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702and checks smooth inputs too.main'sPipeline.cpp, this PR's testsagc_driver_mesh_provoking_vertex0xc0000409):last provoking vertex is unsupported for triangle strips or fans assembled for a geometry programagc_driver_graphicsKhronos validation layer not run: the Vulkan SDK is not installed on this machine.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T18:11:12Z.
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.