panfrost: Identify glProvokingVertex flag
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 27 Dec 2019 20:33:21 +0000 (15:33 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 30 Dec 2019 22:11:08 +0000 (17:11 -0500)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/panfrost/include/panfrost-job.h

index 1446354ade0365762acd186aeecf5681f50eaee6..14c6fcbd155bb5adb59050690c0d46d5382ab4d7 100644 (file)
@@ -1476,9 +1476,8 @@ panfrost_draw_vbo(
 
         draw_flags |= 0x3000;
 
-        if (mode == PIPE_PRIM_LINE_STRIP) {
-                draw_flags |= 0x800;
-        }
+        if (ctx->rasterizer && ctx->rasterizer->base.flatshade_first)
+                draw_flags |= MALI_DRAW_FLATSHADE_FIRST;
 
         panfrost_statistics_record(ctx, info);
 
index fa43f8c32a4bfcb654fb84be5037ec4a49d6d67a..85dd2b40e1d874be2783144596c5553acd88f529 100644 (file)
@@ -884,6 +884,12 @@ struct mali_uniform_buffer_meta {
 #define MALI_DRAW_INDEXED_SHIFT  (4)
 
 #define MALI_DRAW_VARYING_SIZE   (0x100)
+
+/* Set to use first vertex as the provoking vertex for flatshading. Clear to
+ * use the last vertex. This is the default in DX and VK, but not in GL. */
+
+#define MALI_DRAW_FLATSHADE_FIRST (0x800)
+
 #define MALI_DRAW_PRIMITIVE_RESTART_FIXED_INDEX (0x10000)
 
 struct mali_vertex_tiler_prefix {