diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 4c23705..e75f90b 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -88,7 +88,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index ac7fa21..be600e4 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -114,7 +114,9 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); _swrast_span_default_secondary_color(ctx, &span); @@ -249,7 +251,9 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); _swrast_span_default_secondary_color(ctx, &span); @@ -359,7 +363,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (overlapping) { @@ -498,7 +504,9 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, _swrast_span_default_color(ctx, &span); _swrast_span_default_secondary_color(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (overlapping) { diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index cb613b6..7c601a3 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -74,7 +74,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); @@ -343,7 +345,9 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y, if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); /* @@ -442,7 +446,9 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _swrast_span_default_color(ctx, &span); _swrast_span_default_secondary_color(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); @@ -565,7 +571,9 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, _swrast_span_default_secondary_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC)) _swrast_span_default_fog(ctx, &span); if (ctx->Texture._EnabledCoordUnits) _swrast_span_default_texcoords(ctx, &span); diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 5814400..aebef2b 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1031,7 +1031,9 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } /* Fog */ - if (swrast->_FogEnabled) { + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC))) { _swrast_fog_ci_span(ctx, span); } @@ -1578,7 +1580,9 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } /* Fog */ - if (swrast->_FogEnabled) { + if (swrast->_FogEnabled || + (ctx->FragmentProgram._Current && + (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_FOGC))) { _swrast_fog_rgba_span(ctx, span); }