summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-06-26 14:56:20 +0000
committerBrian Paul <[email protected]>2002-06-26 14:56:20 +0000
commitf1ad551604122dd2679dbd31ae6b2fa1197e9848 (patch)
tree18f493a52fd4f32ee8fa8895b77264b456846ba2 /src/mesa/swrast/s_texture.c
parent058f319f60021a48961ed8526453f4034c5012a0 (diff)
fix CHAN_TYPE==GL_FLOAT compile problem
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index ab8b00abee0..405eae95f04 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -1,4 +1,4 @@
-/* $Id: s_texture.c,v 1.63 2002/06/15 03:03:11 brianp Exp $ */
+/* $Id: s_texture.c,v 1.64 2002/06/26 14:56:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -3055,6 +3055,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
(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.0F, CHAN_MAXF);
#else
GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half,
(GLint)arg1[i][RCOMP] - half) +
@@ -3062,8 +3063,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;
-#endif
dot = CLAMP(dot, 0, CHAN_MAX);
+#endif
rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot;
}
}
@@ -3080,6 +3081,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
(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;
#else
GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - half,
(GLint)arg1[i][RCOMP] - half) +
@@ -3087,8 +3089,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;
-#endif
dot = CLAMP(dot, 0, CHAN_MAX) << RGBshift;
+#endif
rgba[i][RCOMP] = rgba[i][GCOMP] = rgba[i][BCOMP] = (GLchan) dot;
}
}