summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-10 19:29:45 -0600
committerBrian Paul <brianp@vmware.com>2009-03-10 19:29:45 -0600
commit5aa1b4c4a745cbb739ae4543fe170a14c99bca02 (patch)
tree52895d11b2e26f9bfa451ae986b207b89c3c66d6
parent86027fd8519ba119db83927c16eb195b601c5280 (diff)
swrast: fix bad optimization check
-rw-r--r--src/mesa/swrast/s_texcombine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index e7f554a3a7a..991f04085b1 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -585,7 +585,8 @@ texture_apply( const GLcontext *ctx,
format = texUnit->_Current->DepthMode;
}
- if (texUnit->EnvMode != GL_REPLACE) {
+ /* skip chan->float conversion when not needed */
+ if (texUnit->EnvMode != GL_REPLACE || format != GL_RGBA) {
/* convert GLchan colors to GLfloat */
for (i = 0; i < n; i++) {
rgba[i][RCOMP] = CHAN_TO_FLOAT(rgbaChan[i][RCOMP]);