From a042211bcbb6af82b49c8fd5a52bb85b57c2ebad Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 21 May 2021 06:50:01 -0400 Subject: [PATCH] aux/cso: set flatshade_first onto vbuf when binding rasterizer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ensure this value is always updated Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/cso_cache/cso_context.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 8ab3d46858c..cc5e7a29771 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -574,6 +574,8 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx, if (ctx->rasterizer != handle) { ctx->rasterizer = handle; ctx->flatshade_first = templ->flatshade_first; + if (ctx->vbuf) + u_vbuf_set_flatshade_first(ctx->vbuf, ctx->flatshade_first); ctx->pipe->bind_rasterizer_state(ctx->pipe, handle); } return PIPE_OK; @@ -593,6 +595,8 @@ cso_restore_rasterizer(struct cso_context *ctx) if (ctx->rasterizer != ctx->rasterizer_saved) { ctx->rasterizer = ctx->rasterizer_saved; ctx->flatshade_first = ctx->flatshade_first_saved; + if (ctx->vbuf) + u_vbuf_set_flatshade_first(ctx->vbuf, ctx->flatshade_first); ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rasterizer_saved); } ctx->rasterizer_saved = NULL;