summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl/t_context.c')
-rw-r--r--src/mesa/tnl/t_context.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 0ace5c2d6f..dd59091770 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -104,10 +104,10 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- if (new_state & (_NEW_HINT)) {
+ if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !fp;
}
tnl->pipeline.new_state |= new_state;
@@ -201,8 +201,8 @@ _tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->AllowVertexFog = value;
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
}
@@ -211,7 +211,7 @@ _tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->AllowPixelFog = value;
- tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
- || !tnl->AllowPixelFog;
+ tnl->_DoVertexFog = ((tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog) && !ctx->FragmentProgram._Current;
}