From b2b4afdc17294d628532593b084bd6105dd995a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mathias=20Fr=C3=B6hlich?= Date: Thu, 27 Feb 2020 08:13:07 +0100 Subject: [PATCH] mesa: set _NEW_FRAG_CLAMP only when needed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/blend.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 0bf27b1..1b84c90 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1063,9 +1063,10 @@ _mesa_ClampColor(GLenum target, GLenum clamp) case GL_CLAMP_FRAGMENT_COLOR_ARB: if (ctx->API == API_OPENGL_CORE) goto invalid_enum; - FLUSH_VERTICES(ctx, _NEW_FRAG_CLAMP); - ctx->Color.ClampFragmentColor = clamp; - _mesa_update_clamp_fragment_color(ctx, ctx->DrawBuffer); + if (ctx->Color.ClampFragmentColor != clamp) { + ctx->Color.ClampFragmentColor = clamp; + _mesa_update_clamp_fragment_color(ctx, ctx->DrawBuffer); + } break; case GL_CLAMP_READ_COLOR_ARB: ctx->Color.ClampReadColor = clamp; @@ -1137,6 +1138,7 @@ _mesa_update_clamp_fragment_color(struct gl_context *ctx, if (ctx->Color._ClampFragmentColor == clamp) return; + ctx->NewState |= _NEW_FRAG_CLAMP; /* for state constants */ ctx->NewDriverState |= ctx->DriverFlags.NewFragClamp; ctx->Color._ClampFragmentColor = clamp; } -- 2.7.4