summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-07-21 18:44:07 -0600
committerBrian Paul <brianp@vmware.com>2015-07-21 18:44:07 -0600
commitd323f26830c1ce7e157cfeeb4f1e38b1a4d19d31 (patch)
tree6c1eb63248ec0187369e101f94f5a0b6b367b389
parent61ed88b1ddf8aea6f74518bcae5c13d9bf4ae822 (diff)
mesa: move check for no-op glAlphaFunc call earlier
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/mesa/main/blend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index 99ab3c354ab..4fc32962425 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -569,6 +569,9 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
_mesa_debug(ctx, "glAlphaFunc(%s, %f)\n",
_mesa_enum_to_string(func), ref);
+ if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRefUnclamped == ref)
+ return; /* no change */
+
switch (func) {
case GL_NEVER:
case GL_LESS:
@@ -578,9 +581,6 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
case GL_NOTEQUAL:
case GL_GEQUAL:
case GL_ALWAYS:
- if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRefUnclamped == ref)
- return; /* no change */
-
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.AlphaFunc = func;
ctx->Color.AlphaRefUnclamped = ref;