aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2020-02-27 08:13:07 +0100
committerMarge Bot <[email protected]>2020-04-30 22:01:55 +0000
commitb2b4afdc17294d628532593b084bd6105dd995a5 (patch)
treed2188f3f8c3d188294e945e59a260398d8059908
parent21ff963c3a1738b44b4e0fb0b9df193103e4d255 (diff)
mesa: set _NEW_FRAG_CLAMP only when needed
Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
-rw-r--r--src/mesa/main/blend.c8
1 files changed, 5 insertions, 3 deletions
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;
}