Mesa (master): mesa: move check for no-op glAlphaFunc call earlier

Brian Paul brianp at kemper.freedesktop.org
Wed Jul 22 00:46:22 UTC 2015


Module: Mesa
Branch: master
Commit: d323f26830c1ce7e157cfeeb4f1e38b1a4d19d31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d323f26830c1ce7e157cfeeb4f1e38b1a4d19d31

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jul 21 18:44:07 2015 -0600

mesa: move check for no-op glAlphaFunc call earlier

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 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 99ab3c3..4fc3296 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;




More information about the mesa-commit mailing list