/*@{*/
-/*
- * Update items which depend on vertex/fragment programs.
- */
static void
-update_program( GLcontext *ctx )
+update_separate_specular( GLcontext *ctx )
{
- if (ctx->FragmentProgram.Enabled && ctx->FragmentProgram.Current) {
- if (ctx->FragmentProgram.Current->InputsRead & (1 << FRAG_ATTRIB_COL1))
- ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
- }
+ if (NEED_SECONDARY_COLOR(ctx))
+ ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
+ else
+ ctx->_TriangleCaps &= ~DD_SEPARATE_SPECULAR;
}
*/
void _mesa_update_state( GLcontext *ctx )
{
- const GLuint new_state = ctx->NewState;
+ GLuint new_state = ctx->NewState;
if (MESA_VERBOSE & VERBOSE_STATE)
_mesa_print_state("_mesa_update_state", new_state);
if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
_mesa_update_modelview_project( ctx, new_state );
- if (new_state & (_NEW_TEXTURE|_NEW_TEXTURE_MATRIX))
+ if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX))
_mesa_update_texture( ctx, new_state );
if (new_state & (_NEW_SCISSOR|_NEW_BUFFERS))
if (new_state & _IMAGE_NEW_TRANSFER_STATE)
_mesa_update_pixel( ctx, new_state );
- if (new_state & _NEW_PROGRAM)
- update_program( ctx );
+ if (new_state & _DD_NEW_SEPARATE_SPECULAR)
+ update_separate_specular( ctx );
- if (new_state & _NEW_ARRAY)
+ if (new_state & (_NEW_ARRAY | _NEW_PROGRAM))
update_arrays( ctx );
/* ctx->_NeedEyeCoords is now up to date.
* Set ctx->NewState to zero to avoid recursion if
* Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
*/
+ new_state = ctx->NewState;
ctx->NewState = 0;
ctx->Driver.UpdateState(ctx, new_state);
ctx->Array.NewState = 0;