From: Mathias Fröhlich Date: Thu, 27 Feb 2020 07:13:07 +0000 (+0100) Subject: mesa: set _NEW_FRAG_CLAMP only when needed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2b4afdc17294d628532593b084bd6105dd995a5;p=mesa.git mesa: set _NEW_FRAG_CLAMP only when needed Reviewed-by: Marek Olšák Part-of: --- diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 0bf27b1f46e..1b84c9077f0 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; }