* The program parser will produce the state[] values.
*/
static void
-_mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
+_mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
gl_constant_value *val)
{
GLfloat *value = &val->f;
/* state[2] is the texgen attribute */
switch (state[2]) {
case STATE_TEXGEN_EYE_S:
- COPY_4V(value, ctx->Texture.Unit[unit].GenS.EyePlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenS.EyePlane);
return;
case STATE_TEXGEN_EYE_T:
- COPY_4V(value, ctx->Texture.Unit[unit].GenT.EyePlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenT.EyePlane);
return;
case STATE_TEXGEN_EYE_R:
- COPY_4V(value, ctx->Texture.Unit[unit].GenR.EyePlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenR.EyePlane);
return;
case STATE_TEXGEN_EYE_Q:
- COPY_4V(value, ctx->Texture.Unit[unit].GenQ.EyePlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenQ.EyePlane);
return;
case STATE_TEXGEN_OBJECT_S:
- COPY_4V(value, ctx->Texture.Unit[unit].GenS.ObjectPlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenS.ObjectPlane);
return;
case STATE_TEXGEN_OBJECT_T:
- COPY_4V(value, ctx->Texture.Unit[unit].GenT.ObjectPlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenT.ObjectPlane);
return;
case STATE_TEXGEN_OBJECT_R:
- COPY_4V(value, ctx->Texture.Unit[unit].GenR.ObjectPlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenR.ObjectPlane);
return;
case STATE_TEXGEN_OBJECT_Q:
- COPY_4V(value, ctx->Texture.Unit[unit].GenQ.ObjectPlane);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].GenQ.ObjectPlane);
return;
default:
_mesa_problem(ctx, "Invalid texgen state in fetch_state");
/* state[1] is the texture unit */
const GLuint unit = (GLuint) state[1];
if (_mesa_get_clamp_fragment_color(ctx, ctx->DrawBuffer))
- COPY_4V(value, ctx->Texture.Unit[unit].EnvColor);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].EnvColor);
else
- COPY_4V(value, ctx->Texture.Unit[unit].EnvColorUnclamped);
+ COPY_4V(value, ctx->Texture.FixedFuncUnit[unit].EnvColorUnclamped);
}
return;
case STATE_FOG_COLOR:
return;
case STATE_NORMAL_SCALE:
- ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
+ ASSIGN_4V(value, ctx->_ModelViewInvScaleEyespace, 0, 0, 1);
return;
case STATE_INTERNAL:
case STATE_FB_WPOS_Y_TRANSFORM:
/* A driver may negate this conditional by using ZW swizzle
* instead of XY (based on e.g. some other state). */
- if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
+ if (!ctx->DrawBuffer->FlipY) {
/* Identity (XY) followed by flipping Y upside down (ZW). */
value[0] = 1.0F;
value[1] = 0.0F;
return;
case STATE_ADVANCED_BLENDING_MODE:
- val[0].i = ctx->Color.BlendEnabled ? ctx->Color._AdvancedBlendMode : 0;
+ val[0].i = _mesa_get_advanced_blend_sh_constant(
+ ctx->Color.BlendEnabled, ctx->Color._AdvancedBlendMode);
return;
/* XXX: make sure new tokens added here are also handled in the
* some GL state has changed.
*/
GLbitfield
-_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH])
+_mesa_program_state_flags(const gl_state_index16 state[STATE_LENGTH])
{
switch (state[0]) {
case STATE_MATERIAL:
return _NEW_LIGHT;
case STATE_TEXGEN:
- return _NEW_TEXTURE;
+ return _NEW_TEXTURE_STATE;
case STATE_TEXENV_COLOR:
- return _NEW_TEXTURE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
+ return _NEW_TEXTURE_STATE | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
case STATE_FOG_COLOR:
return _NEW_FOG | _NEW_BUFFERS | _NEW_FRAG_CLAMP;
* Use free() to deallocate the string.
*/
char *
-_mesa_program_state_string(const gl_state_index state[STATE_LENGTH])
+_mesa_program_state_string(const gl_state_index16 state[STATE_LENGTH])
{
char str[1000] = "";
char tmp[30];
for (i = 0; i < paramList->NumParameters; i++) {
if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {
+ unsigned pvo = paramList->ParameterValueOffset[i];
_mesa_fetch_state(ctx,
paramList->Parameters[i].StateIndexes,
- ¶mList->ParameterValues[i][0]);
+ paramList->ParameterValues + pvo);
}
}
}