r5xx: Enable fog options.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 18 Aug 2008 23:38:21 +0000 (16:38 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 18 Aug 2008 23:38:21 +0000 (16:38 -0700)
This uses fog HW instead of fragment programs.
If it breaks you, let me know!

src/mesa/drivers/dri/r300/r300_state.c

index cce07d3..d71e4f6 100644 (file)
@@ -2622,6 +2622,14 @@ static void r500SetupPixelShader(r300ContextPtr rmesa)
        }
        code = &fp->code;
 
+       if (fp->mesa_program.FogOption != GL_NONE) {
+               /* Enable HW fog.
+                * (Anybody sane remembered to set glFog() opts first! */
+               ctx->Fog.Enabled = GL_TRUE;
+               ctx->Fog.Mode = fp->mesa_program.FogOption;
+               r300SetFogState(ctx, GL_TRUE);
+       }
+
        r300SetupTextures(ctx);
 
        R300_STATECHANGE(rmesa, fp);