mesa: move check for no-op glAlphaFunc call earlier
authorBrian Paul <brianp@vmware.com>
Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 22 Jul 2015 00:44:07 +0000 (18:44 -0600)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/blend.c

index 99ab3c354ab302173efe0dba0f15446340f2ad31..4fc32962425d17df7b80a6bbc8abf9baf8811857 100644 (file)
@@ -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;