summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-08-05 18:12:55 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-08-05 18:12:55 +0000
commite6dea091c0a1fe9ad9720c07ddf7164e5fc45ac6 (patch)
tree834dae37f9cca406a5ee93c7a76f5004e16c354d
parent304d11e0e152d48902becd73004c4e8768b78f3e (diff)
Fix samples/fog.c regression - missing test for NeedEyeCoords.
-rw-r--r--src/mesa/main/light.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 3ef2e3eac1..046738882d 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1317,15 +1317,24 @@ void _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state )
{
const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
- ctx->_NeedEyeCoords = (ctx->_ForceEyeCoords ||
- (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
- ctx->Point._Attenuated ||
- ctx->Light._NeedEyeCoords);
-
+ ctx->_NeedEyeCoords = 0;
+
+ if (ctx->_ForceEyeCoords ||
+ (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
+ ctx->Point._Attenuated ||
+ ctx->Light._NeedEyeCoords)
+ ctx->_NeedEyeCoords = 1;
+
+ if (ctx->Light.Enabled &&
+ !TEST_MAT_FLAGS( ctx->ModelviewMatrixStack.Top,
+ MAT_FLAGS_LENGTH_PRESERVING))
+ ctx->_NeedEyeCoords = 1;
+
+
/* Check if the truth-value interpretations of the bitfields have
* changed:
*/
- if ((oldneedeyecoords == 0) != (ctx->_NeedEyeCoords == 0)) {
+ if (oldneedeyecoords != ctx->_NeedEyeCoords) {
/* Recalculate all state that depends on _NeedEyeCoords.
*/
update_modelview_scale(ctx);