[Mesa-dev] [PATCH 1/2] mesa: remove comparisons that are always true

Jan Vesely jan.vesely at rutgers.edu
Wed Jan 14 12:53:18 PST 2015


Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 src/mesa/program/prog_execute.c   | 1 -
 src/mesa/program/prog_statevars.c | 2 --
 2 files changed, 3 deletions(-)

diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index 33c1751..85aba00 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -1260,7 +1260,6 @@ _mesa_execute_program(struct gl_context * ctx,
                else if (swz == SWIZZLE_ONE)
                   result[i] = 1.0;
                else {
-                  ASSERT(swz >= 0);
                   ASSERT(swz <= 3);
                   result[i] = src[swz];
                }
diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
index be5ddb1..7f5daf8 100644
--- a/src/mesa/program/prog_statevars.c
+++ b/src/mesa/program/prog_statevars.c
@@ -295,9 +295,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
          const gl_state_index modifier = state[4];
          const GLfloat *m;
          GLuint row, i;
-         ASSERT(firstRow >= 0);
          ASSERT(firstRow < 4);
-         ASSERT(lastRow >= 0);
          ASSERT(lastRow < 4);
          if (mat == STATE_MODELVIEW_MATRIX) {
             matrix = ctx->ModelviewMatrixStack.Top;
-- 
2.1.0



More information about the mesa-dev mailing list