[Mesa-dev] [PATCH 2/6] mesa: move check for no-op glAlphaFunc call earlier

Brian Paul brianp at vmware.com
Fri Jul 17 17:48:39 PDT 2015


---
 src/mesa/main/blend.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index d365305..ee6e7d3 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_lookup_enum_by_nr(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;
-- 
1.9.1



More information about the mesa-dev mailing list