From 2432455390acb5bc3380e14b2cd22eefb941adeb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 21 May 2021 06:28:33 -0400 Subject: [PATCH] util/primconvert: add function for setting flatshade_first this is the value that needs to be set, not the actual rasterizer state original function preserved to avoid driver changes Acked-by: Rob Clark Part-of: --- src/gallium/auxiliary/indices/u_primconvert.c | 8 +++++++- src/gallium/auxiliary/indices/u_primconvert.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c index 37d33aa5d6c..b18ddce6a68 100644 --- a/src/gallium/auxiliary/indices/u_primconvert.c +++ b/src/gallium/auxiliary/indices/u_primconvert.c @@ -88,12 +88,18 @@ void util_primconvert_save_rasterizer_state(struct primconvert_context *pc, const struct pipe_rasterizer_state *rast) +{ + util_primconvert_save_flatshade_first(pc, rast->flatshade_first); +} + +void +util_primconvert_save_flatshade_first(struct primconvert_context *pc, bool flatshade_first) { /* if we actually translated the provoking vertex for the buffer, * we would actually need to save/restore rasterizer state. As * it is, we just need to make note of the pv. */ - pc->api_pv = rast->flatshade_first ? PV_FIRST : PV_LAST; + pc->api_pv = flatshade_first ? PV_FIRST : PV_LAST; } void diff --git a/src/gallium/auxiliary/indices/u_primconvert.h b/src/gallium/auxiliary/indices/u_primconvert.h index 080c68a74e7..a4e8892b845 100644 --- a/src/gallium/auxiliary/indices/u_primconvert.h +++ b/src/gallium/auxiliary/indices/u_primconvert.h @@ -49,6 +49,8 @@ void util_primconvert_destroy(struct primconvert_context *pc); void util_primconvert_save_rasterizer_state(struct primconvert_context *pc, const struct pipe_rasterizer_state *rast); +void +util_primconvert_save_flatshade_first(struct primconvert_context *pc, bool flatshade_first); void util_primconvert_draw_vbo(struct primconvert_context *pc, const struct pipe_draw_info *info, unsigned drawid_offset,