switch (pname) {
case GL_FOG_MODE:
- if (!ctx->Fog.Enabled)
- return;
switch (ctx->Fog.Mode) {
case GL_LINEAR:
R300_STATECHANGE(r300, fogs);
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);
}