Fixed MAXFIFO_S4. Removed WAIT_IDLE_EMPTY from savage_BCI_swap which resulted
[mesa.git] / src / mesa / tnl / t_context.c
index ec5f88cd96cd9e36b69e218457c41e3633f21434..2c529afd79ed4dcaa26c5de4007a3b4f4e2c81b3 100644 (file)
@@ -102,6 +102,8 @@ _tnl_CreateContext( GLcontext *ctx )
    tnl->NeedNdcCoords = GL_TRUE;
    tnl->LoopbackDListCassettes = GL_FALSE;
    tnl->CalcDListNormalLengths = GL_TRUE;
+   tnl->AllowVertexFog = GL_TRUE;
+   tnl->AllowPixelFog = GL_TRUE;
 
    /* Hook our functions into exec and compile dispatch tables.
     */
@@ -144,6 +146,12 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
 
+   if (new_state & (_NEW_HINT)) {
+      ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
+      tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+         || !tnl->AllowPixelFog;
+   }
+
    if (new_state & _NEW_ARRAY) {
       tnl->pipeline.run_input_changes |= ctx->Array.NewState; /* overkill */
    }
@@ -259,3 +267,18 @@ _tnl_isolate_materials( GLcontext *ctx, GLboolean mode )
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    tnl->IsolateMaterials = mode;
 }
+
+void
+_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
+{
+   TNLcontext *tnl = TNL_CONTEXT(ctx);
+   tnl->AllowVertexFog = value;
+}
+
+void
+_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
+{
+   TNLcontext *tnl = TNL_CONTEXT(ctx);
+   tnl->AllowPixelFog = value;
+}
+