summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2004-01-23 03:33:04 +0000
committerMichel Dänzer <michel@daenzer.net>2004-01-23 03:33:04 +0000
commita2c97eb2ffad0471aae34ab185461774318a57d6 (patch)
tree9e0016c2f27d290367359ccb43f8e59cb1aaa55a /src/mesa
parent5d00e131d8a264498b8d050c3eded093ee5c42f2 (diff)
Call UpdateMaterial() unconditionally on GL_COLOR_MATERIAL state change
(Roland Scheidegger), and update lighting state unconditionally there. Fixes lighting oddities in the xscreensaver endgame hack, bzflag and possibly elsewhere.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c17
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c17
2 files changed, 14 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 7ea45f3d78..94d5163599 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -959,15 +959,13 @@ void r200UpdateMaterial( GLcontext *ctx )
fcmd[MTL_SHININESS] = mat[MAT_ATTRIB_FRONT_SHININESS][0];
}
- if (R200_DB_STATECHANGE( rmesa, &rmesa->hw.mtl[0] )) {
- for (p = 0 ; p < MAX_LIGHTS; p++)
- update_light_colors( ctx, p );
+ R200_DB_STATECHANGE( rmesa, &rmesa->hw.mtl[0] );
- check_twoside_fallback( ctx );
- update_global_ambient( ctx );
- }
- else if (R200_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
- fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+
+ check_twoside_fallback( ctx );
+ update_global_ambient( ctx );
}
/* _NEW_LIGHT
@@ -1734,8 +1732,7 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_COLOR_MATERIAL:
r200ColorMaterial( ctx, 0, 0 );
- if (!state)
- r200UpdateMaterial( ctx );
+ r200UpdateMaterial( ctx );
break;
case GL_CULL_FACE:
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index db198074ee..3ffff9cc93 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -946,15 +946,13 @@ void radeonUpdateMaterial( GLcontext *ctx )
fcmd[MTL_SHININESS] = mat[MAT_ATTRIB_FRONT_SHININESS][0];
}
- if (RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl )) {
- for (p = 0 ; p < MAX_LIGHTS; p++)
- update_light_colors( ctx, p );
+ RADEON_DB_STATECHANGE( rmesa, &rmesa->hw.mtl );
- check_twoside_fallback( ctx );
- update_global_ambient( ctx );
- }
- else if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
- fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
+ for (p = 0 ; p < MAX_LIGHTS; p++)
+ update_light_colors( ctx, p );
+
+ check_twoside_fallback( ctx );
+ update_global_ambient( ctx );
}
/* _NEW_LIGHT
@@ -1726,8 +1724,7 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_COLOR_MATERIAL:
radeonColorMaterial( ctx, 0, 0 );
- if (!state)
- radeonUpdateMaterial( ctx );
+ radeonUpdateMaterial( ctx );
break;
case GL_CULL_FACE: