*/
static void
_mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
- GLfloat *value)
+ gl_constant_value *val)
{
+ GLfloat *value = &val->f;
+
switch (state[0]) {
case STATE_MATERIAL:
{
}
return;
case STATE_NUM_SAMPLES:
- ((int *)value)[0] = MAX2(1, _mesa_geometric_samples(ctx->DrawBuffer));
+ val[0].i = MAX2(1, _mesa_geometric_samples(ctx->DrawBuffer));
return;
case STATE_DEPTH_RANGE:
value[0] = ctx->ViewportArray[0].Near; /* near */
COPY_4V(value, ctx->FragmentProgram.Parameters[idx]);
return;
case STATE_LOCAL:
- if (!ctx->FragmentProgram.Current->Base.LocalParams) {
- ctx->FragmentProgram.Current->Base.LocalParams =
- calloc(MAX_PROGRAM_LOCAL_PARAMS, sizeof(float[4]));
- if (!ctx->FragmentProgram.Current->Base.LocalParams)
+ if (!ctx->FragmentProgram.Current->arb.LocalParams) {
+ ctx->FragmentProgram.Current->arb.LocalParams =
+ rzalloc_array_size(ctx->FragmentProgram.Current,
+ sizeof(float[4]),
+ MAX_PROGRAM_LOCAL_PARAMS);
+ if (!ctx->FragmentProgram.Current->arb.LocalParams)
return;
}
- COPY_4V(value, ctx->FragmentProgram.Current->Base.LocalParams[idx]);
+ COPY_4V(value,
+ ctx->FragmentProgram.Current->arb.LocalParams[idx]);
return;
default:
_mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
COPY_4V(value, ctx->VertexProgram.Parameters[idx]);
return;
case STATE_LOCAL:
- if (!ctx->VertexProgram.Current->Base.LocalParams) {
- ctx->VertexProgram.Current->Base.LocalParams =
- calloc(MAX_PROGRAM_LOCAL_PARAMS, sizeof(float[4]));
- if (!ctx->VertexProgram.Current->Base.LocalParams)
+ if (!ctx->VertexProgram.Current->arb.LocalParams) {
+ ctx->VertexProgram.Current->arb.LocalParams =
+ rzalloc_array_size(ctx->VertexProgram.Current,
+ sizeof(float[4]),
+ MAX_PROGRAM_LOCAL_PARAMS);
+ if (!ctx->VertexProgram.Current->arb.LocalParams)
return;
}
- COPY_4V(value, ctx->VertexProgram.Current->Base.LocalParams[idx]);
+ COPY_4V(value,
+ ctx->VertexProgram.Current->arb.LocalParams[idx]);
return;
default:
_mesa_problem(ctx, "Bad state switch in _mesa_fetch_state()");
}
return;
+ case STATE_TCS_PATCH_VERTICES_IN:
+ val[0].i = ctx->TessCtrlProgram.patch_vertices;
+ return;
+
+ case STATE_TES_PATCH_VERTICES_IN:
+ if (ctx->TessCtrlProgram._Current)
+ val[0].i = ctx->TessCtrlProgram._Current->info.tcs.vertices_out;
+ else
+ val[0].i = ctx->TessCtrlProgram.patch_vertices;
+ return;
+
+ case STATE_ADVANCED_BLENDING_MODE:
+ val[0].i = ctx->Color.BlendEnabled ? ctx->Color._AdvancedBlendMode : 0;
+ return;
+
/* XXX: make sure new tokens added here are also handled in the
* _mesa_program_state_flags() switch, below.
*/
case STATE_FB_WPOS_Y_TRANSFORM:
return _NEW_BUFFERS;
+ case STATE_ADVANCED_BLENDING_MODE:
+ return _NEW_COLOR;
+
default:
/* unknown state indexes are silently ignored and
* no flag set, since it is handled by the driver.
case STATE_FB_WPOS_Y_TRANSFORM:
append(dst, "FbWposYTransform");
break;
+ case STATE_ADVANCED_BLENDING_MODE:
+ append(dst, "AdvancedBlendingMode");
+ break;
default:
/* probably STATE_INTERNAL_DRIVER+i (driver private state) */
append(dst, "driverState");
if (paramList->Parameters[i].Type == PROGRAM_STATE_VAR) {
_mesa_fetch_state(ctx,
paramList->Parameters[i].StateIndexes,
- ¶mList->ParameterValues[i][0].f);
+ ¶mList->ParameterValues[i][0]);
}
}
}