*/
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:
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;
/* 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 */
*/
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;
{
GLint idx;
GLuint err = 0;
- GLint state_tokens[STATE_LENGTH];
+ gl_state_index state_tokens[STATE_LENGTH];
GLfloat const_values[4];
switch (*(*inst)++) {
*/
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;
/**
* A sequence of STATE_* tokens and integers to identify GL state.
*/
- GLint StateIndexes[STATE_LENGTH];
+ gl_state_index StateIndexes[STATE_LENGTH];
};
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,
* 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:
* 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];
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 */
* 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] */
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;
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);
}
}
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;
}
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);