From 71df7c69bc44a2daddf07efa03bf0526aea533ee Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 27 Dec 2019 15:33:21 -0500 Subject: [PATCH] panfrost: Identify glProvokingVertex flag Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 5 ++--- src/panfrost/include/panfrost-job.h | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 1446354ade0..14c6fcbd155 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -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); diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h index fa43f8c32a4..85dd2b40e1d 100644 --- a/src/panfrost/include/panfrost-job.h +++ b/src/panfrost/include/panfrost-job.h @@ -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 { -- 2.30.2