r5xx: Final fog option fix.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 19 Aug 2008 16:24:27 +0000 (09:24 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 19 Aug 2008 16:24:27 +0000 (09:24 -0700)
Is there some kind of git hook we could use to keep me from committing
after like 10PM or so?

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

index 820b8dff300454351eb8f131194a70eb99a04e29..15cd05316186cd68a08348b8a0a5c6b9e1760d91 100644 (file)
@@ -2623,10 +2623,12 @@ static void r500SetupPixelShader(r300ContextPtr rmesa)
        if (fp->mesa_program.FogOption != GL_NONE) {
                /* Enable HW fog. Try not to squish GL context.
                 * (Anybody sane remembered to set glFog() opts first!) */
+               r300SetFogState(ctx, GL_TRUE);
                ctx->Fog.Mode = fp->mesa_program.FogOption;
                r300Fogfv(ctx, GL_FOG_MODE, NULL);
-               r300SetFogState(ctx, GL_TRUE);
-       }
+       } else
+               /* Make sure HW is matching GL context. */
+               r300SetFogState(ctx, ctx->Fog.Enabled);
 
        r300SetupTextures(ctx);