nv2a: Fix vertex ordering of triangle strips in polygon line mode

This fixes nxdk_pgraph_tests W_param tests a bit more. Note that the
geometry shader approach in Xemu for polygon line mode doesn't currently
implement face culling. It could be improved by using the built-in
gl_FrontFacing variable in the geometry shader.
This commit is contained in:
coldhex
2025-10-24 15:31:28 -04:00
committed by mborgerson
parent a18240e897
commit 594f787343
-20
View File
@@ -139,26 +139,6 @@ MString *pgraph_glsl_gen_geom(const GeomState *state, GenGeomGlslOptions opts)
" EndPrimitive();\n";
break;
case PRIM_TYPE_TRIANGLE_STRIP:
if (polygon_mode == POLY_MODE_FILL) { return NULL; }
assert(polygon_mode == POLY_MODE_LINE);
layout_in = "layout(triangles) in;\n";
layout_out = "layout(line_strip, max_vertices = 4) out;\n";
/* Imagine a quad made of a tristrip, the comments tell you which
* vertex we are using */
body = " if ((gl_PrimitiveIDIn & 1) == 0) {\n"
" if (gl_PrimitiveIDIn == 0) {\n"
" emit_vertex(0, 0);\n" /* bottom right */
" }\n"
" emit_vertex(1, 0);\n" /* top right */
" emit_vertex(2, 0);\n" /* bottom left */
" emit_vertex(0, 0);\n" /* bottom right */
" } else {\n"
" emit_vertex(2, 0);\n" /* bottom left */
" emit_vertex(1, 0);\n" /* top left */
" emit_vertex(0, 0);\n" /* top right */
" }\n"
" EndPrimitive();\n";
break;
case PRIM_TYPE_TRIANGLE_FAN:
if (polygon_mode == POLY_MODE_FILL) { return NULL; }
assert(polygon_mode == POLY_MODE_LINE);