Make sure tnl->_DoVertexFog is kept uptodate. Fixes fog in i915
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Nov 2005 10:58:05 +0000 (10:58 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 22 Nov 2005 10:58:05 +0000 (10:58 +0000)
driver.

src/mesa/tnl/t_context.c

index 5aea2d1..30b2947 100644 (file)
@@ -273,6 +273,9 @@ _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;
+
 }
 
 void
@@ -280,5 +283,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;
 }