fix(agc): honour primitive restart in mesh-path triangle fans #12125
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12125"
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 Oscar45397 on 2026-10-27T22:09:39Z.
What
An indexed triangle fan drawn through the mesh path (NGG,
inputPrimitive5) refused any draw whose index buffer held the restart index (primitive restart in a triangle fan geometry draw is unsupported). This follows8c06af0ad9(mesh-path strips) and reuses its restart table:MeshRestartStartyields 0, so the centre stays at slot 0 and lane 0 still fetches the first index.Tested
Windows 11 Home 26300, Ryzen 9 5900X, NVIDIA GeForce RTX 3080 (driver 610.88), WinLibs GCC 15.2.0 r7, Release, rebased onto
mainb28bb77217, which now has #7893. TheInstructionTranslator.cppconflict with #7893's provoking-vertex fan order is resolved as in @thuanquang's merge88c90472f3(https://github.com/boykopovar/AnyPS5/pull/7893#issuecomment-6572457124): the fan centre slot takes #7893'su32(0u)places (first with the last provoking vertex, third with the first), and each fan slot goes throughunlessRestarted.Mesh.cpp: the refusal check is replaced by drawing quads as four-index fans each followed by a restart (16- and 32-bit indices, and an indirect draw starting mid-buffer), with three primitives per group so segments cross group boundaries and with front faces culled, so every quad must render whole with the strips' winding while the gaps stay clear; plus a whole fan followed by a restart. With the translator change reverted the first new check fails (16-bit triangle fans with restarts: quad 0 right half pixel (69, 253, 200, 255)).MeshProvokingVertex.cpp(@thuanquang's commitaec17935c7, kept as is): two fans split by a restart,{1, 0, 2, 0xffff, 2, 3, 1}, drawn through a geometry program in both provoking modes; the second fan's centre is vertex 2, so its triangle takes vertex 1's colour with the last provoking vertex and vertex 3's with the first. Their run shows that taking either side of the conflict fails this case or #7893's strip case.ctest --test-dir build -R "mesh|provoking|barycentric|agc_driver_graphics$" -V(14 tests) withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationonmainb28bb77217and on this branch (head1ad6fe9894), same machine, 3 runs each: 14 of 14 pass on both in every run, and the branch'sagc_driver_mesh_provoking_vertexsuccess line names the new restart case. Neither log has aVUID-line, aValidation Erroror the missing-layer message, and both log the same 20WARNING-lines per run.inputs.minIndex = lowest;above theinputPrimitivecheck this PR widens inDraw.cpp; keeping both lines resolves it.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