switch (mat) {
case MATRIX_MODELVIEW:
- *matrix = STATE_MODELVIEW;
+ *matrix = STATE_MODELVIEW_MATRIX;
*matrix_idx = parse_integer (inst, Program);
if (*matrix_idx > 0) {
program_error(ctx, Program->Position,
break;
case MATRIX_PROJECTION:
- *matrix = STATE_PROJECTION;
+ *matrix = STATE_PROJECTION_MATRIX;
break;
case MATRIX_MVP:
- *matrix = STATE_MVP;
+ *matrix = STATE_MVP_MATRIX;
break;
case MATRIX_TEXTURE:
- *matrix = STATE_TEXTURE;
+ *matrix = STATE_TEXTURE_MATRIX;
*matrix_idx = parse_integer (inst, Program);
if (*matrix_idx >= (GLint) ctx->Const.MaxTextureUnits) {
program_error(ctx, Program->Position, "Invalid Texture Unit");
break;
case MATRIX_PROGRAM:
- *matrix = STATE_PROGRAM;
+ *matrix = STATE_PROGRAM_MATRIX;
*matrix_idx = parse_integer (inst, Program);
if (*matrix_idx >= (GLint) ctx->Const.MaxProgramMatrices) {
program_error(ctx, Program->Position, "Invalid Program Matrix");
case STATE_FOG:
switch (*(*inst)++) {
case FOG_COLOR:
- state_tokens[0] = STATE_FOG_COLOR;
+ state_tokens[0] = STATE_FOG;
+ state_tokens[1] = STATE_FOG_COLOR;
break;
case FOG_PARAMS:
- state_tokens[0] = STATE_FOG_PARAMS;
+ state_tokens[0] = STATE_FOG;
+ state_tokens[1] = STATE_FOG_PARAMS;
break;
}
break;
/* XXX: I think this is the correct format for a matrix row */
case STATE_MATRIX_ROWS:
- state_tokens[0] = STATE_MATRIX;
if (parse_matrix
- (ctx, inst, Program, &state_tokens[1], &state_tokens[2],
- &state_tokens[5]))
+ (ctx, inst, Program, &state_tokens[0], &state_tokens[1],
+ &state_tokens[4]))
return 1;
- state_tokens[3] = parse_integer (inst, Program); /* The first row to grab */
+ state_tokens[2] = parse_integer (inst, Program); /* The first row to grab */
if ((**inst) != 0) { /* Either the last row, 0 */
- state_tokens[4] = parse_integer (inst, Program);
- if (state_tokens[4] < state_tokens[3]) {
+ state_tokens[3] = parse_integer (inst, Program);
+ if (state_tokens[3] < state_tokens[2]) {
program_error(ctx, Program->Position,
"Second matrix index less than the first");
/* state_tokens[4] vs. state_tokens[3] */
}
}
else {
- state_tokens[4] = state_tokens[3];
+ state_tokens[3] = state_tokens[2];
(*inst)++;
}
break;
/* If we adding STATE_MATRIX that has multiple rows, we need to
* unroll it and call _mesa_add_state_reference() for each row
*/
- if ((state_tokens[0] == STATE_MATRIX)
- && (state_tokens[3] != state_tokens[4])) {
+ if ((state_tokens[0] == STATE_MODELVIEW_MATRIX ||
+ state_tokens[0] == STATE_PROJECTION_MATRIX ||
+ state_tokens[0] == STATE_MVP_MATRIX ||
+ state_tokens[0] == STATE_TEXTURE_MATRIX ||
+ state_tokens[0] == STATE_PROGRAM_MATRIX)
+ && (state_tokens[2] != state_tokens[3])) {
GLint row;
- GLint first_row = state_tokens[3];
- GLint last_row = state_tokens[4];
+ const GLint first_row = state_tokens[2];
+ const GLint last_row = state_tokens[3];
for (row = first_row; row <= last_row; row++) {
- state_tokens[3] = state_tokens[4] = row;
+ state_tokens[2] = state_tokens[3] = row;
idx = _mesa_add_state_reference(Program->Base.Parameters,
state_tokens);
fprintf (stderr, "STATE_TEXGEN ");
break;
+ case STATE_FOG:
+ fprintf (stderr, "STATE_FOG ");
+ break;
+
case STATE_FOG_COLOR:
fprintf (stderr, "STATE_FOG_COLOR ");
break;
COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
}
return;
- case STATE_FOG_COLOR:
- COPY_4V(value, ctx->Fog.Color);
- return;
- case STATE_FOG_PARAMS:
- value[0] = ctx->Fog.Density;
- value[1] = ctx->Fog.Start;
- value[2] = ctx->Fog.End;
- value[3] = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ case STATE_FOG:
+ if (state[1] == STATE_FOG_COLOR) {
+ COPY_4V(value, ctx->Fog.Color);
+ }
+ else {
+ ASSERT(state[1] == STATE_FOG_PARAMS);
+ value[0] = ctx->Fog.Density;
+ value[1] = ctx->Fog.Start;
+ value[2] = ctx->Fog.End;
+ value[3] = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ }
return;
case STATE_CLIPPLANE:
{
value[2] = ctx->Point.Params[2];
value[3] = 1.0F;
return;
- case STATE_MATRIX:
+ case STATE_MODELVIEW_MATRIX:
+ case STATE_PROJECTION_MATRIX:
+ case STATE_MVP_MATRIX:
+ case STATE_TEXTURE_MATRIX:
+ case STATE_PROGRAM_MATRIX:
+ /*case STATE_MATRIX:*/
{
/* state[1] = modelview, projection, texture, etc. */
/* state[2] = which texture matrix or program matrix */
/* state[5] = transpose, inverse or invtrans */
const GLmatrix *matrix;
+#if 0
const gl_state_index mat = state[1];
const GLuint index = (GLuint) state[2];
const GLuint firstRow = (GLuint) state[3];
const GLuint lastRow = (GLuint) state[4];
const gl_state_index modifier = state[5];
+#else
+ const gl_state_index mat = state[0];
+ const GLuint index = (GLuint) state[1];
+ const GLuint firstRow = (GLuint) state[2];
+ const GLuint lastRow = (GLuint) state[3];
+ const gl_state_index modifier = state[4];
+#endif
const GLfloat *m;
GLuint row, i;
- if (mat == STATE_MODELVIEW) {
+ ASSERT(firstRow >= 0);
+ ASSERT(firstRow < 4);
+ ASSERT(lastRow >= 0);
+ ASSERT(lastRow < 4);
+ if (mat == STATE_MODELVIEW_MATRIX) {
matrix = ctx->ModelviewMatrixStack.Top;
}
- else if (mat == STATE_PROJECTION) {
+ else if (mat == STATE_PROJECTION_MATRIX) {
matrix = ctx->ProjectionMatrixStack.Top;
}
- else if (mat == STATE_MVP) {
+ else if (mat == STATE_MVP_MATRIX) {
matrix = &ctx->_ModelProjectMatrix;
}
- else if (mat == STATE_TEXTURE) {
+ else if (mat == STATE_TEXTURE_MATRIX) {
matrix = ctx->TextureMatrixStack[index].Top;
}
- else if (mat == STATE_PROGRAM) {
+ else if (mat == STATE_PROGRAM_MATRIX) {
matrix = ctx->ProgramMatrixStack[index].Top;
}
else {
case STATE_TEXENV_COLOR:
return _NEW_TEXTURE;
+ case STATE_FOG:
+#if 0
case STATE_FOG_COLOR:
case STATE_FOG_PARAMS:
+#endif
return _NEW_FOG;
case STATE_CLIPPLANE:
case STATE_POINT_ATTENUATION:
return _NEW_POINT;
- case STATE_MATRIX:
- switch (state[1]) {
- case STATE_MODELVIEW:
- return _NEW_MODELVIEW;
- case STATE_PROJECTION:
- return _NEW_PROJECTION;
- case STATE_MVP:
- return _NEW_MODELVIEW | _NEW_PROJECTION;
- case STATE_TEXTURE:
- return _NEW_TEXTURE_MATRIX;
- case STATE_PROGRAM:
- return _NEW_TRACK_MATRIX;
- default:
- _mesa_problem(NULL,
- "unexpected matrix in _mesa_program_state_flags()");
- return 0;
- }
+ case STATE_MODELVIEW_MATRIX:
+ return _NEW_MODELVIEW;
+ case STATE_PROJECTION_MATRIX:
+ return _NEW_PROJECTION;
+ case STATE_MVP_MATRIX:
+ return _NEW_MODELVIEW | _NEW_PROJECTION;
+ case STATE_TEXTURE_MATRIX:
+ return _NEW_TEXTURE_MATRIX;
+ case STATE_PROGRAM_MATRIX:
+ return _NEW_TRACK_MATRIX;
case STATE_DEPTH_RANGE:
return _NEW_VIEWPORT;
case STATE_TEXGEN:
append(dst, "texgen");
break;
+ case STATE_FOG:
+ append(dst, "fog");
+ break;
case STATE_FOG_COLOR:
- append(dst, "fog.color");
+ append(dst, ".color");
break;
case STATE_FOG_PARAMS:
- append(dst, "fog.params");
+ append(dst, ".params");
break;
case STATE_CLIPPLANE:
append(dst, "clip");
case STATE_POINT_ATTENUATION:
append(dst, "point.attenuation");
break;
- case STATE_MATRIX:
- append(dst, "matrix.");
- break;
- case STATE_MODELVIEW:
+ case STATE_MODELVIEW_MATRIX:
append(dst, "modelview");
break;
- case STATE_PROJECTION:
+ case STATE_PROJECTION_MATRIX:
append(dst, "projection");
break;
- case STATE_MVP:
+ case STATE_MVP_MATRIX:
append(dst, "mvp");
break;
- case STATE_TEXTURE:
+ case STATE_TEXTURE_MATRIX:
append(dst, "texture");
break;
- case STATE_PROGRAM:
+ case STATE_PROGRAM_MATRIX:
append(dst, "program");
break;
case STATE_MATRIX_INVERSE:
append_index(str, state[1]); /* tex unit [i] */
append(str, "color");
break;
- case STATE_FOG_COLOR:
- case STATE_FOG_PARAMS:
+ case STATE_FOG:
+ append(str, "fog");
+ append_token(str, (gl_state_index) state[1]); /* color or params */
break;
case STATE_CLIPPLANE:
append_index(str, state[1]); /* plane [i] */
case STATE_POINT_SIZE:
case STATE_POINT_ATTENUATION:
break;
- case STATE_MATRIX:
+ case STATE_MODELVIEW_MATRIX:
+ case STATE_PROJECTION_MATRIX:
+ case STATE_MVP_MATRIX:
+ case STATE_TEXTURE_MATRIX:
+ case STATE_PROGRAM_MATRIX:
{
- /* state[1] = modelview, projection, texture, etc. */
- /* state[2] = which texture matrix or program matrix */
- /* state[3] = first row to fetch */
- /* state[4] = last row to fetch */
- /* state[5] = transpose, inverse or invtrans */
- const gl_state_index mat = (gl_state_index) state[1];
- const GLuint index = (GLuint) state[2];
- const GLuint firstRow = (GLuint) state[3];
- const GLuint lastRow = (GLuint) state[4];
- const gl_state_index modifier = (gl_state_index) state[5];
+ /* state[0] = modelview, projection, texture, etc. */
+ /* state[1] = which texture matrix or program matrix */
+ /* state[2] = first row to fetch */
+ /* state[3] = last row to fetch */
+ /* state[4] = transpose, inverse or invtrans */
+ const gl_state_index mat = (gl_state_index) state[0];
+ const GLuint index = (GLuint) state[1];
+ const GLuint firstRow = (GLuint) state[2];
+ const GLuint lastRow = (GLuint) state[3];
+ const gl_state_index modifier = (gl_state_index) state[4];
append_token(str, mat);
if (index)
append_index(str, index);
* fragment programs.
* A string such as "state.light[0].ambient" gets translated into a
* sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
+ *
+ * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
+ * always be the array index.
*/
typedef enum gl_state_index_ {
STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
STATE_TEXGEN,
+ STATE_FOG,
STATE_FOG_COLOR,
STATE_FOG_PARAMS,
STATE_POINT_SIZE,
STATE_POINT_ATTENUATION,
- STATE_MATRIX,
- STATE_MODELVIEW,
- STATE_PROJECTION,
- STATE_MVP,
- STATE_TEXTURE,
- STATE_PROGRAM,
+ STATE_MODELVIEW_MATRIX,
+ STATE_PROJECTION_MATRIX,
+ STATE_MVP_MATRIX,
+ STATE_TEXTURE_MATRIX,
+ STATE_PROGRAM_MATRIX,
STATE_MATRIX_INVERSE,
STATE_MATRIX_TRANSPOSE,
STATE_MATRIX_INVTRANS,
* XXX we should check if these state vars are already declared.
*/
static const GLint mvpState[4][5] = {
- { STATE_MATRIX, STATE_MVP, 0, 0, 0 }, /* state.matrix.mvp.row[0] */
- { STATE_MATRIX, STATE_MVP, 0, 1, 1 }, /* state.matrix.mvp.row[1] */
- { STATE_MATRIX, STATE_MVP, 0, 2, 2 }, /* state.matrix.mvp.row[2] */
- { STATE_MATRIX, STATE_MVP, 0, 3, 3 }, /* state.matrix.mvp.row[3] */
+ { 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] */
+ { STATE_MVP_MATRIX, 0, 3, 3, 0 }, /* state.matrix.mvp.row[3] */
};
GLint mvpRef[4];
void
_mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
{
- static const GLint fogParamsState[] = { STATE_FOG_PARAMS, 0, 0, 0, 0 };
- static const GLint fogColorState[] = { STATE_FOG_COLOR, 0, 0, 0, 0 };
+ static const GLint fogParamsState[]
+ = { STATE_FOG, STATE_FOG_PARAMS, 0, 0, 0 };
+ static const GLint fogColorState[]
+ = { STATE_FOG, STATE_FOG_COLOR, 0, 0, 0 };
struct prog_instruction *newInst, *inst;
const GLuint origLen = fprog->Base.NumInstructions;
const GLuint newLen = origLen + 6;
};
static const struct state_info state[] = {
{ "gl_ModelViewMatrix", 4, SWIZZLE_NOOP,
- { STATE_MATRIX, STATE_MODELVIEW, 0, 0, 0, 0 } },
+ { STATE_MODELVIEW_MATRIX, 0, 0, 0, 0, 0 } },
{ "gl_NormalMatrix", 3, SWIZZLE_NOOP,
- { STATE_MATRIX, STATE_MODELVIEW, 0, 0, 0, 0 } },
+ { STATE_MODELVIEW_MATRIX, 0, 0, 0, 0, 0 } },
{ "gl_ProjectionMatrix", 4, SWIZZLE_NOOP,
- { STATE_MATRIX, STATE_PROJECTION, 0, 0, 0, 0 } },
+ { STATE_PROJECTION_MATRIX, 0, 0, 0, 0, 0 } },
{ "gl_ModelViewProjectionMatrix", 4, SWIZZLE_NOOP,
- { STATE_MATRIX, STATE_MVP, 0, 0, 0, 0 } },
+ { STATE_MVP_MATRIX, 0, 0, 0, 0, 0 } },
{ "gl_TextureMatrix", 4, SWIZZLE_NOOP,
- { STATE_MATRIX, STATE_TEXTURE, 0, 0, 0, 0 } },
+ { STATE_TEXTURE_MATRIX, 0, 0, 0, 0, 0 } },
{ "gl_NormalScale", 1, SWIZZLE_NOOP,
{ STATE_INTERNAL, STATE_NORMAL_SCALE, 0, 0, 0, 0} },
{ "gl_Fog", 1, SWIZZLE_NOOP,
- { STATE_FOG_COLOR, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_COLOR, 0, 0, 0, 0 } },
{ "gl_Fog.color", 1, SWIZZLE_NOOP,
- { STATE_FOG_COLOR, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_COLOR, 0, 0, 0, 0 } },
{ "gl_Fog.density", 1, SWIZZLE_XXXX,
- { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_PARAMS, 0, 0, 0, 0 } },
{ "gl_Fog.start", 1, SWIZZLE_YYYY,
- { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_PARAMS, 0, 0, 0, 0 } },
{ "gl_Fog.end", 1, SWIZZLE_ZZZZ,
- { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_PARAMS, 0, 0, 0, 0 } },
{ "gl_Fog.scale", 1, SWIZZLE_WWWW,
- { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 } },
+ { STATE_FOG, STATE_FOG_PARAMS, 0, 0, 0, 0 } },
{ "gl_ClipPlane", 1, SWIZZLE_NOOP,
{ STATE_CLIPPLANE, 0, 0, 0, 0, 0 } },
indexesCopy[j] = state[i].Indexes[j];
/* load rows */
for (j = 0; j < state[i].NumRows; j++) {
- indexesCopy[3] = indexesCopy[4] = j; /* jth row of matrix */
+ indexesCopy[2] = indexesCopy[3] = j; /* jth row of matrix */
pos[j] = _mesa_add_state_reference(paramList, indexesCopy);
assert(pos[j] >= 0);
}
static const struct state_uniform_info Uniforms[] = {
- { "gl_ModelViewMatrix", { STATE_MATRIX, STATE_MODELVIEW },
+ { "gl_ModelViewMatrix", { STATE_MODELVIEW_MATRIX, INDEX_POS },
{ MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD}
},
- { "gl_ProjectionMatrix", { STATE_MATRIX, STATE_PROJECTION },
+ { "gl_ProjectionMatrix", { STATE_PROJECTION_MATRIX, INDEX_POS },
{ MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD}
},
- { "gl_ModelViewProjectionMatrix", { STATE_MATRIX, STATE_MVP },
+ { "gl_ModelViewProjectionMatrix", { STATE_MVP_MATRIX, INDEX_POS },
{ MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD}
},
- { "gl_NormalMatrix", { STATE_MATRIX, STATE_MODELVIEW },
+ { "gl_NormalMatrix", { STATE_MODELVIEW_MATRIX, INDEX_POS },
{ MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD}
},
- { "gl_TextureMatrix", { STATE_MATRIX, STATE_TEXTURE },
+ { "gl_TextureMatrix", { STATE_TEXTURE_MATRIX, INDEX_POS },
{ MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD, MT_FIELD}
},
}
},
- { "gl_Fog", { 0, 0 },
+ { "gl_Fog", { STATE_FOG, 0 },
{
- { "color", STATE_FOG_COLOR, 0, SWIZZLE_NOOP },
- { "density", STATE_FOG_PARAMS, 0, SWIZZLE_XXXX },
- { "start", STATE_FOG_PARAMS, 0, SWIZZLE_YYYY },
- { "end", STATE_FOG_PARAMS, 0, SWIZZLE_ZZZZ },
- { "scale", STATE_FOG_PARAMS, 0, SWIZZLE_WWWW }
+ { "color", STATE_FOG_COLOR, 1, SWIZZLE_NOOP },
+ { "density", STATE_FOG_PARAMS, 1, SWIZZLE_XXXX },
+ { "start", STATE_FOG_PARAMS, 1, SWIZZLE_YYYY },
+ { "end", STATE_FOG_PARAMS, 1, SWIZZLE_ZZZZ },
+ { "scale", STATE_FOG_PARAMS, 1, SWIZZLE_WWWW }
}
},
}
}
- if (tokens[0] == STATE_MATRIX) {
+ if (tokens[0] == STATE_MODELVIEW_MATRIX ||
+ tokens[0] == STATE_PROJECTION_MATRIX ||
+ tokens[0] == STATE_MVP_MATRIX ||
+ tokens[0] == STATE_TEXTURE_MATRIX ||
+ tokens[0] == STATE_PROGRAM_MATRIX) {
/* a matrix */
GLuint j;
GLint pos[4];
indexesCopy[j] = tokens[j];
/* load rows */
for (j = 0; j < 4/*state[i].NumRows*/; j++) {
- indexesCopy[3] = indexesCopy[4] = j; /* jth row of matrix */
+ indexesCopy[2] = indexesCopy[3] = j; /* jth row of matrix */
pos[j] = _mesa_add_state_reference(paramList, (GLint*) indexesCopy);
assert(pos[j] >= 0);
}
n->Store->Index = _slang_alloc_statevar(n, prog->Parameters);
return NULL;
}
-
+#if 0
if (n->Children[0]->Store->File == PROGRAM_STATE_VAR) {
/* state variable sub-field */
GLint pos;
n->Store->Index = pos;
n->Store->Swizzle = swizzle;
}
+#endif
else {
_mesa_problem(NULL, "structs/fields not supported yet");
}
p->eye_position = reserve_temp(p);
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3,
- STATE_MATRIX, modelview );
+ register_matrix_param6( p, STATE_MODELVIEW_MATRIX, 0, 0, 3,
+ 0, 0, modelview );
emit_matrix_transform_vec4(p, p->eye_position, modelview, pos);
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 3,
- STATE_MATRIX_TRANSPOSE, modelview );
+ register_matrix_param6( p, STATE_MODELVIEW_MATRIX, 0, 0, 3,
+ STATE_MATRIX_TRANSPOSE, 0, modelview );
emit_transpose_matrix_transform_vec4(p, p->eye_position, modelview, pos);
}
struct ureg normal = register_input(p, VERT_ATTRIB_NORMAL );
struct ureg mvinv[3];
- register_matrix_param6( p, STATE_MATRIX, STATE_MODELVIEW, 0, 0, 2,
- STATE_MATRIX_INVTRANS, mvinv );
+ register_matrix_param6( p, STATE_MODELVIEW_MATRIX, 0, 0, 2,
+ STATE_MATRIX_INVTRANS, 0, mvinv );
p->eye_normal = reserve_temp(p);
struct ureg mvp[4];
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3,
- STATE_MATRIX, mvp );
+ register_matrix_param6( p, STATE_MVP_MATRIX, 0, 0, 3,
+ 0, 0, mvp );
emit_matrix_transform_vec4( p, hpos, mvp, pos );
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_MVP, 0, 0, 3,
- STATE_MATRIX_TRANSPOSE, mvp );
+ register_matrix_param6( p, STATE_MVP_MATRIX, 0, 0, 3,
+ STATE_MATRIX_TRANSPOSE, 0, mvp );
emit_transpose_matrix_transform_vec4( p, hpos, mvp, pos );
}
}
}
if (p->state->tnl_do_vertex_fog) {
- struct ureg params = register_param1(p, STATE_FOG_PARAMS);
+ struct ureg params = register_param2(p, STATE_FOG, STATE_FOG_PARAMS);
struct ureg tmp = get_temp(p);
switch (p->state->fog_mode) {
out_texgen :
register_input(p, VERT_ATTRIB_TEX0+i));
if (PREFER_DP4) {
- register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i,
- 0, 3, STATE_MATRIX, texmat );
+ register_matrix_param6( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+ 0, 0, texmat );
emit_matrix_transform_vec4( p, out, texmat, in );
}
else {
- register_matrix_param6( p, STATE_MATRIX, STATE_TEXTURE, i,
- 0, 3, STATE_MATRIX_TRANSPOSE, texmat );
+ register_matrix_param6( p, STATE_TEXTURE_MATRIX, i, 0, 3,
+ STATE_MATRIX_TRANSPOSE, 0, texmat );
emit_transpose_matrix_transform_vec4( p, out, texmat, in );
}
}