diff options
author | marha <marha@users.sourceforge.net> | 2015-03-05 23:40:39 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-03-05 23:42:09 +0100 |
commit | c646056120fe14e4c4ccf81bac5d78d61225a8e8 (patch) | |
tree | ba0af42750f0ab6dc4724342a7063835636222b5 /mesalib/src/mesa/program/prog_statevars.c | |
parent | 87e58a93f7248171e736656080069cb65ff56aae (diff) | |
parent | 8574eba804031f6b19713f0b02952280730bf62e (diff) | |
download | vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.gz vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.bz2 vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/drivers/dri/swrast/swrast.c
mesalib/src/mesa/main/.gitignore
mesalib/src/mesa/main/queryobj.c
Diffstat (limited to 'mesalib/src/mesa/program/prog_statevars.c')
-rw-r--r-- | mesalib/src/mesa/program/prog_statevars.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mesalib/src/mesa/program/prog_statevars.c b/mesalib/src/mesa/program/prog_statevars.c index 7f5daf8c6..57b25a7e3 100644 --- a/mesalib/src/mesa/program/prog_statevars.c +++ b/mesalib/src/mesa/program/prog_statevars.c @@ -29,6 +29,7 @@ */ +#include <stdio.h> #include "main/glheader.h" #include "main/context.h" #include "main/blend.h" @@ -41,6 +42,9 @@ #include "main/samplerobj.h" +#define ONE_DIV_SQRT_LN2 (1.201122408786449815) + + /** * Use the list of tokens in the state[] array to find global GL state * and return it in <value>. Usually, four values are returned in <value> @@ -58,9 +62,9 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], /* state[1] is either 0=front or 1=back side */ const GLuint face = (GLuint) state[1]; const struct gl_material *mat = &ctx->Light.Material; - ASSERT(face == 0 || face == 1); + assert(face == 0 || face == 1); /* we rely on tokens numbered so that _BACK_ == _FRONT_+ 1 */ - ASSERT(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); + assert(MAT_ATTRIB_FRONT_AMBIENT + 1 == MAT_ATTRIB_BACK_AMBIENT); /* XXX we could get rid of this switch entirely with a little * work in arbprogparse.c's parse_state_single_item(). */ @@ -170,7 +174,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], const GLuint ln = (GLuint) state[1]; const GLuint face = (GLuint) state[2]; GLint i; - ASSERT(face == 0 || face == 1); + assert(face == 0 || face == 1); switch (state[3]) { case STATE_AMBIENT: for (i = 0; i < 3; i++) { @@ -295,8 +299,8 @@ _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 < 4); - ASSERT(lastRow < 4); + assert(firstRow < 4); + assert(lastRow < 4); if (mat == STATE_MODELVIEW_MATRIX) { matrix = ctx->ModelviewMatrixStack.Top; } @@ -307,11 +311,11 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], matrix = &ctx->_ModelProjectMatrix; } else if (mat == STATE_TEXTURE_MATRIX) { - ASSERT(index < Elements(ctx->TextureMatrixStack)); + assert(index < ARRAY_SIZE(ctx->TextureMatrixStack)); matrix = ctx->TextureMatrixStack[index].Top; } else if (mat == STATE_PROGRAM_MATRIX) { - ASSERT(index < Elements(ctx->ProgramMatrixStack)); + assert(index < ARRAY_SIZE(ctx->ProgramMatrixStack)); matrix = ctx->ProgramMatrixStack[index].Top; } else { |