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 5aea2d16281e6da072763396d35e75a8e6d5cd4b..30b2947323a356300d33320f0746957124ccf674 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;
 }