r300: Correct bug introduced by fragprog rework.
authorJerome Glisse <glisse@freedesktop.org>
Thu, 4 Jan 2007 19:27:49 +0000 (20:27 +0100)
committerJerome Glisse <glisse@freedesktop.org>
Thu, 4 Jan 2007 19:31:35 +0000 (20:31 +0100)
Thx for Tilman who spoted the bugs.

src/mesa/drivers/dri/r300/r300_fragprog.c

index f00162a6dc76835550f6ed445ca2d787418d8b25..179bc58e9e924096fbe982cee0ca5ea9ab4f19ec 100644 (file)
@@ -257,7 +257,7 @@ static const GLuint undef = REG(REG_TYPE_TEMP,
                                GL_FALSE);
 
 /* constant one source */
-static const GLuint pfs_one = REG(REG_TYPE_TEMP,
+static const GLuint pfs_one = REG(REG_TYPE_CONST,
                                  0,
                                  SWIZZLE_111,
                                  SWIZZLE_ONE,
@@ -265,7 +265,7 @@ static const GLuint pfs_one = REG(REG_TYPE_TEMP,
                                  GL_TRUE);
 
 /* constant half source */
-static const GLuint pfs_half = REG(REG_TYPE_TEMP,
+static const GLuint pfs_half = REG(REG_TYPE_CONST,
                                   0,
                                   SWIZZLE_HHH,
                                   SWIZZLE_HALF,
@@ -273,7 +273,7 @@ static const GLuint pfs_half = REG(REG_TYPE_TEMP,
                                   GL_TRUE);
 
 /* constant zero source */
-static const GLuint pfs_zero = REG(REG_TYPE_TEMP,
+static const GLuint pfs_zero = REG(REG_TYPE_CONST,
                                   0,
                                   SWIZZLE_000,
                                   SWIZZLE_ZERO,
@@ -463,7 +463,8 @@ static int swz_native(struct r300_fragment_program *rp,
                      GLuint arbneg)
 {
        /* Native swizzle, handle negation */
-       src |= ((arbneg >> 3) & 1) << REG_NEGS_SHIFT;
+       src = (src & ~REG_NEGS_SHIFT) |
+               (((arbneg >> 3) & 1) << REG_NEGS_SHIFT);
 
        if ((arbneg & 0x7) == 0x0) {
                src = src & ~REG_NEGV_MASK;