r5xx: Don't squish GL context when using FogOption
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 19 Aug 2008 10:40:27 +0000 (03:40 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 19 Aug 2008 10:40:27 +0000 (03:40 -0700)
src/mesa/drivers/dri/r300/r300_state.c

index d71e4f6fe9c8f1c35e1100bad6c51d7662276e10..820b8dff300454351eb8f131194a70eb99a04e29 100644 (file)
@@ -747,8 +747,6 @@ static void r300Fogfv(GLcontext * ctx, GLenum pname, const GLfloat * param)
 
        switch (pname) {
        case GL_FOG_MODE:
-               if (!ctx->Fog.Enabled)
-                       return;
                switch (ctx->Fog.Mode) {
                case GL_LINEAR:
                        R300_STATECHANGE(r300, fogs);
@@ -2623,10 +2621,10 @@ 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;
+               /* Enable HW fog. Try not to squish GL context.
+                * (Anybody sane remembered to set glFog() opts first!) */
                ctx->Fog.Mode = fp->mesa_program.FogOption;
+               r300Fogfv(ctx, GL_FOG_MODE, NULL);
                r300SetFogState(ctx, GL_TRUE);
        }