Per the spec. This helper is only used in nv50 and panfrost, the latter is known
to have a completely broken transform feedback implementation and I'd be
unsurprised if the same is true for nv50. So unsurprising that compatibility
profile interaction was missed.
This is part of the Piglit ext_transform_feedback-tessellation quads puzzle.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22013>
/* One output per vertex after decomposition */
enum pipe_prim_type base = u_base_prim_type(primitive);
+
+ /* The GL 4.6 compatibility spec says
+ *
+ * When quads and polygons are provided to transform feedback with a
+ * primitive mode of TRIANGLES, they will be tessellated and recorded as
+ * triangles (the order of tessellation within a primitive is undefined)
+ *
+ * Further, quads and polygons are always provided as TRIANGLES. So
+ * tessellate quads into triangles.
+ */
+ if (base == PIPE_PRIM_QUADS) {
+ base = PIPE_PRIM_TRIANGLES;
+ prims *= 2;
+ }
+
return u_vertices_for_prims(base, prims);
}