summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-11-12 19:27:24 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-11-12 19:27:24 +0000
commit7069a7e3d670a27573aa158fe53c9e906f40fe19 (patch)
treec6cd558b6a6f0ae2a8e6087034fa70f48e2712b9 /src/mesa
parentd5cbe1e924b4daf3f04de17148d973e88e4d4de8 (diff)
apply scale factor before clapping for DOT3
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/swrast/s_texture.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index 73fbccff64..60091e3743 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -1,8 +1,8 @@
-/* $Id: s_texture.c,v 1.74 2002/10/28 23:01:24 kschultz Exp $ */
+/* $Id: s_texture.c,v 1.75 2002/11/12 19:27:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -3139,8 +3139,8 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
GLchan dot = ((arg0[i][RCOMP]-0.5F) * (arg1[i][RCOMP]-0.5F) +
(arg0[i][GCOMP]-0.5F) * (arg1[i][GCOMP]-0.5F) +
(arg0[i][BCOMP]-0.5F) * (arg1[i][BCOMP]-0.5F))
- * 4.0F;
- dot = CLAMP(dot, 0.0, CHAN_MAXF) * RGBmult;
+ * 4.0F * RGBmult;
+ dot = CLAMP(dot, 0.0, CHAN_MAXF);
#else
GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half,
(GLint)arg1[i][RCOMP] - half) +
@@ -3148,7 +3148,8 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
(GLint)arg1[i][GCOMP] - half) +
S_PROD((GLint)arg0[i][BCOMP] - half,
(GLint)arg1[i][BCOMP] - half)) >> 6;
- dot = CLAMP(dot, 0, CHAN_MAX) << RGBshift;
+ dot <<= RGBshift;
+ dot = CLAMP(dot, 0, CHAN_MAX);
#endif
rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot;
}