aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fog.c
diff options
context:
space:
mode:
authorGustaw Smolarczyk <[email protected]>2017-03-30 20:09:29 +0200
committerMarek Olšák <[email protected]>2017-04-08 20:29:58 +0200
commit6fa34de8308fd4abc2fb23aa9071a35cb08552c9 (patch)
tree378af442a2e421057c379b82f32052d9cf364c69 /src/mesa/main/fog.c
parentc9b2938aeccfe131329b25e378264cc1d0080be2 (diff)
mesa/main: Maintain compressed fog mode.
Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/fog.c')
-rw-r--r--src/mesa/main/fog.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 1ad939cfde6..76e65080b74 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -102,8 +102,13 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
m = (GLenum) (GLint) *params;
switch (m) {
case GL_LINEAR:
+ ctx->Fog._PackedMode = FOG_LINEAR;
+ break;
case GL_EXP:
+ ctx->Fog._PackedMode = FOG_EXP;
+ break;
case GL_EXP2:
+ ctx->Fog._PackedMode = FOG_EXP2;
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
@@ -113,6 +118,8 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
ctx->Fog.Mode = m;
+ ctx->Fog._PackedEnabledMode = ctx->Fog.Enabled ?
+ ctx->Fog._PackedMode : FOG_NONE;
break;
case GL_FOG_DENSITY:
if (*params<0.0F) {
@@ -210,6 +217,8 @@ void _mesa_init_fog( struct gl_context * ctx )
/* Fog group */
ctx->Fog.Enabled = GL_FALSE;
ctx->Fog.Mode = GL_EXP;
+ ctx->Fog._PackedMode = FOG_EXP;
+ ctx->Fog._PackedEnabledMode = FOG_NONE;
ASSIGN_4V( ctx->Fog.Color, 0.0, 0.0, 0.0, 0.0 );
ASSIGN_4V( ctx->Fog.ColorUnclamped, 0.0, 0.0, 0.0, 0.0 );
ctx->Fog.Index = 0.0;