From aa9d22a1c0f3256497088985c290d4046e089456 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 23 Feb 2007 11:21:03 -0700 Subject: replace GLint with gl_state_index --- src/mesa/shader/arbprogparse.c | 18 +++++++++++------- src/mesa/shader/prog_parameter.c | 2 +- src/mesa/shader/prog_parameter.h | 4 ++-- src/mesa/shader/prog_statevars.c | 4 ++-- src/mesa/shader/prog_statevars.h | 4 ++-- src/mesa/shader/programopt.c | 6 +++--- src/mesa/shader/slang/slang_builtin.c | 4 ++-- src/mesa/shader/slang/slang_link.c | 2 +- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 43e2c7e1be..6058fc9889 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1085,7 +1085,8 @@ parse_matrix (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Progra */ static GLuint parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLint * state_tokens) + struct arb_program *Program, + gl_state_index state_tokens[STATE_LENGTH]) { switch (*(*inst)++) { case STATE_MATERIAL_PARSER: @@ -1269,7 +1270,8 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, case STATE_CLIP_PLANE: state_tokens[0] = STATE_CLIPPLANE; state_tokens[1] = parse_integer (inst, Program); - if (parse_clipplane_num (ctx, inst, Program, &state_tokens[1])) + if (parse_clipplane_num (ctx, inst, Program, + (GLint *) &state_tokens[1])) return 1; break; @@ -1287,9 +1289,10 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, /* XXX: I think this is the correct format for a matrix row */ case STATE_MATRIX_ROWS: - if (parse_matrix - (ctx, inst, Program, &state_tokens[0], &state_tokens[1], - &state_tokens[4])) + if (parse_matrix(ctx, inst, Program, + (GLint *) &state_tokens[0], + (GLint *) &state_tokens[1], + (GLint *) &state_tokens[4])) return 1; state_tokens[2] = parse_integer (inst, Program); /* The first row to grab */ @@ -1345,7 +1348,8 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, */ static GLuint parse_program_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLint * state_tokens) + struct arb_program *Program, + gl_state_index state_tokens[STATE_LENGTH]) { if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) state_tokens[0] = STATE_FRAGMENT_PROGRAM; @@ -1720,7 +1724,7 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst, { GLint idx; GLuint err = 0; - GLint state_tokens[STATE_LENGTH]; + gl_state_index state_tokens[STATE_LENGTH]; GLfloat const_values[4]; switch (*(*inst)++) { diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 505c5016ac..14b272c2c5 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -370,7 +370,7 @@ sizeof_state_reference(const GLint *stateTokens) */ GLint _mesa_add_state_reference(struct gl_program_parameter_list *paramList, - const GLint stateTokens[STATE_LENGTH]) + const gl_state_index stateTokens[STATE_LENGTH]) { const GLuint size = 4; /* XXX fix */ const char *name; diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 459643f425..3d32a64f38 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -50,7 +50,7 @@ struct gl_program_parameter /** * A sequence of STATE_* tokens and integers to identify GL state. */ - GLint StateIndexes[STATE_LENGTH]; + gl_state_index StateIndexes[STATE_LENGTH]; }; @@ -115,7 +115,7 @@ _mesa_add_attribute(struct gl_program_parameter_list *paramList, extern GLint _mesa_add_state_reference(struct gl_program_parameter_list *paramList, - const GLint stateTokens[STATE_LENGTH]); + const gl_state_index stateTokens[STATE_LENGTH]); extern GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 0d70af3b27..93d9244523 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -439,7 +439,7 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], * some GL state has changed. */ GLbitfield -_mesa_program_state_flags(const GLint state[STATE_LENGTH]) +_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) { switch (state[0]) { case STATE_MATERIAL: @@ -678,7 +678,7 @@ append_index(char *dst, GLint index) * Use _mesa_free() to deallocate the string. */ const char * -_mesa_program_state_string(const GLint state[STATE_LENGTH]) +_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) { char str[1000] = ""; char tmp[30]; diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h index 82169342cd..3281a4a2a0 100644 --- a/src/mesa/shader/prog_statevars.h +++ b/src/mesa/shader/prog_statevars.h @@ -119,11 +119,11 @@ _mesa_load_state_parameters(GLcontext *ctx, extern GLbitfield -_mesa_program_state_flags(const GLint state[STATE_LENGTH]); +_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]); extern const char * -_mesa_program_state_string(const GLint state[STATE_LENGTH]); +_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]); #endif /* PROG_STATEVARS_H */ diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 18da39c2d3..2d14cd3855 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -56,7 +56,7 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) * Setup state references for the modelview/projection matrix. * XXX we should check if these state vars are already declared. */ - static const GLint mvpState[4][STATE_LENGTH] = { + static const gl_state_index mvpState[4][STATE_LENGTH] = { { STATE_MVP_MATRIX, 0, 0, 0, 0 }, /* state.matrix.mvp.row[0] */ { STATE_MVP_MATRIX, 0, 1, 1, 0 }, /* state.matrix.mvp.row[1] */ { STATE_MVP_MATRIX, 0, 2, 2, 0 }, /* state.matrix.mvp.row[2] */ @@ -125,9 +125,9 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) void _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) { - static const GLint fogPStateOpt[STATE_LENGTH] + static const gl_state_index fogPStateOpt[STATE_LENGTH] = { STATE_INTERNAL, STATE_FOG_PARAMS_OPTIMIZED, 0, 0, 0 }; - static const GLint fogColorState[STATE_LENGTH] + static const gl_state_index fogColorState[STATE_LENGTH] = { STATE_FOG_COLOR, 0, 0, 0, 0}; struct prog_instruction *newInst, *inst; const GLuint origLen = fprog->Base.NumInstructions; diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 2e4687afc5..b01b74d359 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -309,7 +309,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, GLuint j; for (j = 0; j < 4; j++) { tokens[2] = tokens[3] = j; /* jth row of matrix */ - pos[j] = _mesa_add_state_reference(paramList, (GLint *) tokens); + pos[j] = _mesa_add_state_reference(paramList, tokens); assert(pos[j] >= 0); ASSERT(pos[j] >= 0); } @@ -317,7 +317,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, } else { /* allocate a single register */ - GLint pos = _mesa_add_state_reference(paramList, (GLint *) tokens); + GLint pos = _mesa_add_state_reference(paramList, tokens); ASSERT(pos >= 0); return pos; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index e2bb6ee2d8..f468a8cbc2 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -199,7 +199,7 @@ link_uniform_vars(struct gl_shader_program *shProg, struct gl_program *prog) j = _mesa_add_named_constant(shProg->Uniforms, p->Name, pVals, p->Size); break; case PROGRAM_STATE_VAR: - j = _mesa_add_state_reference(shProg->Uniforms, (const GLint *) p->StateIndexes); + j = _mesa_add_state_reference(shProg->Uniforms, p->StateIndexes); break; case PROGRAM_UNIFORM: j = _mesa_add_uniform(shProg->Uniforms, p->Name, p->Size); -- cgit v1.2.3