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 cce07d338bb9c4e609762f7887a8ca005322393b..d71e4f6fe9c8f1c35e1100bad6c51d7662276e10 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);