From: Brian Paul Date: Wed, 11 Mar 2009 01:29:45 +0000 (-0600) Subject: swrast: fix bad optimization check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84b24efe8dc1bd67680f4d3c656fb4693fd405c1;p=mesa.git swrast: fix bad optimization check --- diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 3b7bbfe2583..ef2db0dc7e3 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -604,7 +604,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]);