Mesa (master): swrast: flip the conditionals in shadow_compare4() for readability

Brian Paul brianp at kemper.freedesktop.org
Tue Mar 8 15:32:24 UTC 2011


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Mar  8 08:31:12 2011 -0700

swrast: flip the conditionals in shadow_compare4() for readability

---

 src/mesa/swrast/s_texfilter.c |   48 ++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 4b0a4bc..4278540 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -2918,40 +2918,40 @@ shadow_compare4(GLenum function, GLfloat coord,
 
    switch (function) {
    case GL_LEQUAL:
-      if (depth00 < coord)  luminance -= d;
-      if (depth01 < coord)  luminance -= d;
-      if (depth10 < coord)  luminance -= d;
-      if (depth11 < coord)  luminance -= d;
+      if (coord > depth00)  luminance -= d;
+      if (coord > depth01)  luminance -= d;
+      if (coord > depth10)  luminance -= d;
+      if (coord > depth11)  luminance -= d;
       return luminance;
    case GL_GEQUAL:
-      if (depth00 > coord)  luminance -= d;
-      if (depth01 > coord)  luminance -= d;
-      if (depth10 > coord)  luminance -= d;
-      if (depth11 > coord)  luminance -= d;
+      if (coord < depth00)  luminance -= d;
+      if (coord < depth01)  luminance -= d;
+      if (coord < depth10)  luminance -= d;
+      if (coord < depth11)  luminance -= d;
       return luminance;
    case GL_LESS:
-      if (depth00 <= coord)  luminance -= d;
-      if (depth01 <= coord)  luminance -= d;
-      if (depth10 <= coord)  luminance -= d;
-      if (depth11 <= coord)  luminance -= d;
+      if (coord >= depth00)  luminance -= d;
+      if (coord >= depth01)  luminance -= d;
+      if (coord >= depth10)  luminance -= d;
+      if (coord >= depth11)  luminance -= d;
       return luminance;
    case GL_GREATER:
-      if (depth00 >= coord)  luminance -= d;
-      if (depth01 >= coord)  luminance -= d;
-      if (depth10 >= coord)  luminance -= d;
-      if (depth11 >= coord)  luminance -= d;
+      if (coord <= depth00)  luminance -= d;
+      if (coord <= depth01)  luminance -= d;
+      if (coord <= depth10)  luminance -= d;
+      if (coord <= depth11)  luminance -= d;
       return luminance;
    case GL_EQUAL:
-      if (depth00 != coord)  luminance -= d;
-      if (depth01 != coord)  luminance -= d;
-      if (depth10 != coord)  luminance -= d;
-      if (depth11 != coord)  luminance -= d;
+      if (coord != depth00)  luminance -= d;
+      if (coord != depth01)  luminance -= d;
+      if (coord != depth10)  luminance -= d;
+      if (coord != depth11)  luminance -= d;
       return luminance;
    case GL_NOTEQUAL:
-      if (depth00 == coord)  luminance -= d;
-      if (depth01 == coord)  luminance -= d;
-      if (depth10 == coord)  luminance -= d;
-      if (depth11 == coord)  luminance -= d;
+      if (coord == depth00)  luminance -= d;
+      if (coord == depth01)  luminance -= d;
+      if (coord == depth10)  luminance -= d;
+      if (coord == depth11)  luminance -= d;
       return luminance;
    case GL_ALWAYS:
       return 1.0F;




More information about the mesa-commit mailing list