diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 8ddc10200ba..2ec208c9dba 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -457,7 +457,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) _mesa_update_modelview_project( ctx, new_state ); if (new_state & _NEW_TEXTURE_MATRIX) - _mesa_update_texture_matrices(ctx); + new_state |= _mesa_update_texture_matrices(ctx); if (new_state & (_NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE | _NEW_PROGRAM)) new_state |= _mesa_update_texture_state(ctx); @@ -493,8 +493,8 @@ _mesa_update_state_locked( struct gl_context *ctx ) } if (ctx->VertexProgram._UsesTnlProgram) { - prog_flags |= _NEW_FF_VERT_PROGRAM | _NEW_TEXTURE_MATRIX | - _NEW_TRANSFORM | _NEW_POINT | _NEW_FOG; + prog_flags |= _NEW_FF_VERT_PROGRAM | _NEW_TRANSFORM | _NEW_POINT | + _NEW_FOG; } if (new_state & prog_flags) { diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 3beb5363cf6..1e8baea06a3 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -387,10 +387,11 @@ _mesa_ClientActiveTexture(GLenum texture) * * \param ctx GL context. */ -void +GLbitfield _mesa_update_texture_matrices(struct gl_context *ctx) { GLuint u; + GLbitfield old_texmat_enabled = ctx->Texture._TexMatEnabled; ctx->Texture._TexMatEnabled = 0x0; @@ -404,6 +405,11 @@ _mesa_update_texture_matrices(struct gl_context *ctx) ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u); } } + + if (old_texmat_enabled != ctx->Texture._TexMatEnabled) + return _NEW_FF_VERT_PROGRAM | _NEW_FF_FRAG_PROGRAM; + + return 0; } diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index 1244f77c9e9..bc9a6457305 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -109,7 +109,7 @@ _mesa_ClientActiveTexture( GLenum target ); */ /*@{*/ -extern void +extern GLbitfield _mesa_update_texture_matrices(struct gl_context *ctx); extern GLbitfield