aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl/t_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/tnl/t_context.c')
-rw-r--r--mesalib/src/mesa/tnl/t_context.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/mesalib/src/mesa/tnl/t_context.c b/mesalib/src/mesa/tnl/t_context.c
index 9faa54fdf..aaa564fae 100644
--- a/mesalib/src/mesa/tnl/t_context.c
+++ b/mesalib/src/mesa/tnl/t_context.c
@@ -138,16 +138,12 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
}
}
- if (ctx->Fog.Enabled) {
- /* fixed-function fog */
+ if (ctx->Fog.Enabled
+ || (fp != NULL && (fp->Base.InputsRead & FRAG_BIT_FOGC) != 0)) {
+ /* Either fixed-function fog or a fragment program needs fog coord.
+ */
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
}
- else if (fp) {
- if (fp->FogOption != GL_NONE || (fp->Base.InputsRead & FRAG_BIT_FOGC)) {
- /* fragment program needs fog coord */
- RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
- }
- }
if (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL)