fix(agc): honour primitive restart in mesh-path triangle strips #2757
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2757"
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 TheAggie on 2026-10-10T13:07:20Z.
What
A geometry (NGG) triangle-strip draw on the mesh path ignored primitive restart. The mesh prologue gives every primitive the next index positions and never checks for the restart index. So a triangle spanning a restart fetched vertex 0xFFFF and was drawn to wherever that read landed. The strip parity also never reset at a restart: after an odd-length strip, every following triangle's winding flipped, and face culling dropped it.
#1968 already leaves the restart index out of a draw's vertex range. This PR handles the strips themselves:
MeshRestartStart, reads the table at a position (clamped to its length).Fans keep their existing rule (
primitive restart in a triangle fan geometry draw is unsupported); lists are unchanged.Found running RetroArch's Dolphin core (PPSA99169) through RADV: GameCube quads arrive as four-index strips separated by restarts, and drew as streaks to the screen origin.
Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.
agc_driver_mesh. It draws quads as four-index strips, each followed by a restart, with front faces culled, using 16- and 32-bit indices plus an indirect draw that starts mid-buffer. Every quad must render whole and the gaps between them must stay clear. With the table flag turned off it fails:16-bit triangle strips with restarts: a triangle crossed the restart after quad 0.maincf8b129e2. Full suite: 551 of 554 pass, 1 skipped. The two failures,agc_driver_prepared_shaders_debug_failureandguest_memory, fail the same way on cleanmaincf8b129e2on this machine. It was run from the generatedCTestTestfile.cmakecommands because antivirus blocksctest.exeon this machine.tools/check_conventions.pypasses.main, and RetroArch can't reach Dolphin onmainalone.Not tested on AMD, Intel, Linux or macOS.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T16:31:37Z.
Native Windows run, on NVIDIA and Intel, in case it helps since this was found on RADV.
Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release. RTX 5060 Laptop GPU (32.0.16.1742) and an Arrow Lake iGPU (Core Ultra 9 275HX, 32.0.101.8991) in the same machine.
8c06af0acherry-picked ontomain57f96fd2without conflicts. Intel mesh draws render nothing onmain(#2815), so I added that fix (377829ec) on top to be able to run the mesh test there at all; it doesn't change anything on NVIDIA, where mesh stages run at 32 lanes anyway. The iGPU runs useAPS5_NO_PIPELINE_LTO=1to keep the #2777 race out.agc_driver_mesh, including the new 16-bit, 32-bit, indirect and front-culled strips with restarts: passes 3/3 on both GPUs.--parallel 6): 709/709 on the RTX 5060. On the iGPU the only failures are the five that fail onmainand have their own fixes (f64_fma_subnormals,fp16_overflow,vop1_float_unary,vopc_comparein #2114 and #2822,lds_beyond_device_limitin #2805).AI-assisted (Claude Code); the numbers above are from runs on this machine.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:46:30Z.
Checked on Linux (RADV):
agc_driver_meshpasses on the PR merged onto currentmain, and fails with the non-test changes reverted. The restart table, the newMeshRestartStartop and the prologue changes are consistent with the draw path (direct, in-place import and indirect). No conflict with the merged #2253. Also confirmed by @Silverash-i8 on Windows (RTX 5060 and Intel iGPU); merging.