swrast: fix incorrect arithmetic for GL_ADD_SIGNED/GL_COMBINE4_NV mode
authorBrian Paul <brianp@vmware.com>
Mon, 6 Apr 2009 20:38:09 +0000 (14:38 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 6 Apr 2009 20:38:09 +0000 (14:38 -0600)
src/mesa/swrast/s_texcombine.c

index 2c694c25cba1b78e2675d669236e3c45feb017b1..08752f343317faea4eee1d5dafa788e4f1da060a 100644 (file)
@@ -316,12 +316,12 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
          if (textureUnit->EnvMode == GL_COMBINE4_NV) {
             /* (a * b) + (c * d) - 0.5 */
             for (i = 0; i < n; i++) {
-               rgba[i][RCOMP] = (arg0[i][RCOMP] + arg1[i][RCOMP] *
-                                 arg2[i][RCOMP] + arg3[i][RCOMP] - 0.5) * scaleRGB;
-               rgba[i][GCOMP] = (arg0[i][GCOMP] + arg1[i][GCOMP] *
-                                 arg2[i][GCOMP] + arg3[i][GCOMP] - 0.5) * scaleRGB;
-               rgba[i][BCOMP] = (arg0[i][BCOMP] + arg1[i][BCOMP] *
-                                 arg2[i][BCOMP] + arg3[i][BCOMP] - 0.5) * scaleRGB;
+               rgba[i][RCOMP] = (arg0[i][RCOMP] * arg1[i][RCOMP] +
+                                 arg2[i][RCOMP] * arg3[i][RCOMP] - 0.5) * scaleRGB;
+               rgba[i][GCOMP] = (arg0[i][GCOMP] * arg1[i][GCOMP] +
+                                 arg2[i][GCOMP] * arg3[i][GCOMP] - 0.5) * scaleRGB;
+               rgba[i][BCOMP] = (arg0[i][BCOMP] * arg1[i][BCOMP] +
+                                 arg2[i][BCOMP] * arg3[i][BCOMP] - 0.5) * scaleRGB;
             }
          }
          else {