r5xx: Negation masks for every inst except SWZ.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 25 May 2008 18:35:54 +0000 (11:35 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 25 May 2008 18:35:54 +0000 (11:35 -0700)
Yay?

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

index 2c18c3f6fdab7d2d1dd1c1b9e26807fd79f54c11..c7b551d4b896e86a01bad17c1a57e40e86e5eed7 100644 (file)
@@ -117,8 +117,10 @@ static inline GLuint make_rgb_swizzle(struct prog_src_register src) {
                temp = GET_SWZ(src.Swizzle, i);
                /* Fix SWIZZLE_ONE */
                if (temp == 5) temp++;
-               swiz += temp << i*3;
+               swiz |= temp << i*3;
        }
+       if (src.NegateBase)
+               swiz |= (R500_SWIZ_MOD_NEG << 10);
        return swiz;
 }
 
@@ -126,6 +128,10 @@ static inline GLuint make_alpha_swizzle(struct prog_src_register src) {
        GLuint swiz = GET_SWZ(src.Swizzle, 3);
 
        if (swiz == 5) swiz++;
+
+       if (src.NegateBase)
+               swiz |= (R500_SWIZ_MOD_NEG << 4);
+
        return swiz;
 }