From: Brian Paul Date: Tue, 8 Mar 2011 15:31:12 +0000 (-0700) Subject: swrast: flip the conditionals in shadow_compare4() for readability X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a802738b08b1dbddef6c59d0a1324f864b987b0;p=mesa.git swrast: flip the conditionals in shadow_compare4() for readability --- diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 4b0a4bcec18..42785400c0e 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;