Compute/setup fog coordinates even if vertex program is enabled.
authorH. Verbeet <hverbeet@gmail.com>
Mon, 16 Jun 2008 16:40:32 +0000 (10:40 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 16 Jun 2008 16:40:32 +0000 (10:40 -0600)
Only when fog's enabled, of course.
In the usual case, this is just a pass-through operation.

src/mesa/tnl/t_pipeline.c
src/mesa/tnl/t_vb_fog.c

index 2a0ed8852a2b027ba986da59cc85b199622d1308..357ef1e24b5bf4914fe2b3e3b4e31d86eb314ae3 100644 (file)
@@ -199,11 +199,11 @@ const struct tnl_pipeline_stage *_tnl_default_pipeline[] = {
    &_tnl_vertex_transform_stage,
    &_tnl_normal_transform_stage,
    &_tnl_lighting_stage,
-   &_tnl_fog_coordinate_stage,
    &_tnl_texgen_stage,
    &_tnl_texture_transform_stage,
    &_tnl_point_attenuation_stage,
    &_tnl_vertex_program_stage, 
+   &_tnl_fog_coordinate_stage,
    &_tnl_render_stage,
    NULL 
 };
index d8bca3820bc8ee7b5a1281e2e0f99ccc232faf1e..99e5a09c755a990c4ae8527a2d6556ebcdf88891 100644 (file)
@@ -148,11 +148,11 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
    struct fog_stage_data *store = FOG_STAGE_DATA(stage);
    GLvector4f *input;
 
-   if (!ctx->Fog.Enabled || ctx->VertexProgram._Current)
-      return GL_TRUE;
 
+   if (!ctx->Fog.Enabled)
+      return GL_TRUE;
 
-   if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT) {
+   if (ctx->Fog.FogCoordinateSource == GL_FRAGMENT_DEPTH_EXT && !ctx->VertexProgram._Current) {
       GLuint i;
       GLfloat *coord;
       /* Fog is computed from vertex or fragment Z values */