summaryrefslogtreecommitdiffstats
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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 626aa5290e6..2c529afd79e 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -103,6 +103,7 @@ _tnl_CreateContext( GLcontext *ctx )
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.
*/
@@ -146,7 +147,9 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (new_state & (_NEW_HINT)) {
- tnl->_DoVertexFog = tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST);
+ ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
+ tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
+ || !tnl->AllowPixelFog;
}
if (new_state & _NEW_ARRAY) {
@@ -272,3 +275,10 @@ _tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
tnl->AllowVertexFog = value;
}
+void
+_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ tnl->AllowPixelFog = value;
+}
+