From: Alyssa Rosenzweig Date: Fri, 27 Dec 2019 20:33:21 +0000 (-0500) Subject: panfrost: Identify glProvokingVertex flag X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71df7c69bc44a2daddf07efa03bf0526aea533ee;p=mesa.git panfrost: Identify glProvokingVertex flag Signed-off-by: Alyssa Rosenzweig --- 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 {