AGC: a geometry shader on a triangle strip or fan only draws the first input primitive (XPSemu PPSA97358 GPU probe) #23642
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LeandroLP23 on 2026-11-19T11:31:40Z.
What happens
On the mesh path, a draw whose NGG geometry program reads a triangle strip or fan only rasterizes the output of the first input primitive. XPSemu's start-up GPU probe reads black where the second triangle of each strip and fan should be:
Could not determine triangle strip1 rotation, got color: R=0, G=0, B=0.Title, test or build step
XPSemu (PPSA97358, catalog Alpha-2.1), an xemu port. The probe is
render_geom_shader_trianglesin xemu'shw/xbox/nv2a/pgraph/vk/gpuprops.c. It runs one pass-through geometry shader (layout(triangles) in; layout(triangle_strip, max_vertices = 3) out;, threeEmitVertexcalls and oneEndPrimitiveper input triangle) over three draws into a 640x480 target: a triangle list of 3 vertices, a triangle strip of 4 and a triangle fan of 4. Then it reads one pixel inside each of the 5 triangles.AnyPS5 commit
main74f685158e, no PRs on top.System
Windows 11 (10.0.26300), AMD Radeon 860M (AMD 26.10.2, LLPC), WinLibs GCC 15.2.0 r7, Release.
Host report
Steps to reproduce
python tools/title_run.py PPSA97358 --games <games> --build build --out <out> --runs 1 --seconds 60. The probe's lines are indata/xemu/xemu.login the work folder, within the first 4 s.Log
What was checked
strip0message) and triangle 1 is black. In the fan, triangle 0 is green (colors[8], its first vertex) and triangle 1 is black. So in each draw, only the first primitive through the geometry program reaches the target.main; this readback is the part left. babyhuey saw the same three lines on an RTX 3080 on 18 October, so it isn't AMD-specific.APS5_DUMP_PREPARE_INPUTS=1 APS5_DUMP_SHADERS=200240d00,200241600, the geometry program0x200240d00(linked with pixel program0x200241600) is prepared three times.agc_shader_replayreports: The draw-side count inDraw.cppgives 2 primitives for 4 strip or fan vertices.InstructionTranslator.cppgives primitive 1 the group-local vertices (1, 3, 2) for the strip and (2, 3, 0) for the fan. Those have the same winding as Vulkan's strip and fan order, so back-face culling (the probe culls back faces, clockwise front) shouldn't drop them, and neither is degenerate.MeshProvokingVertexalready checks that strip and fan draw their second triangle on the mesh path, but with a program that outputs one primitive per input primitive. Here the geometry program is radv's NGG lowering of a real geometry shader: each invocation emits its vertices into LDS, and the subgroup's output counts are combined across lanes and declared withGS_ALLOC_REQ.AI-assisted: yes (Claude Code)