vc4: Don't bother saturating the dst color for blending.
authorEric Anholt <eric@anholt.net>
Sat, 1 Aug 2015 00:08:46 +0000 (17:08 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 5 Aug 2015 00:19:01 +0000 (17:19 -0700)
Since we just pulled it out of the destination as 8-bit unorm, we know
it's in [0, 1] already.

shader-db:
total instructions in shared programs: 100040 -> 98208 (-1.83%)
instructions in affected programs:     14084 -> 12252 (-13.01%)

src/gallium/drivers/vc4/vc4_program.c

index 5e2a3f448a0b1087269ed0c4c7614fb9011c3f4b..d6c60739e934549317c7480484fd5b1c3c9a844d 100644 (file)
@@ -1130,14 +1130,8 @@ vc4_blend(struct vc4_compile *c, struct qreg *result,
                 return;
         }
 
-        struct qreg clamped_src[4];
-        struct qreg clamped_dst[4];
-        for (int i = 0; i < 4; i++) {
-                clamped_src[i] = qir_SAT(c, src_color[i]);
-                clamped_dst[i] = qir_SAT(c, dst_color[i]);
-        }
-        src_color = clamped_src;
-        dst_color = clamped_dst;
+        for (int i = 0; i < 4; i++)
+                src_color[i] = qir_SAT(c, src_color[i]);
 
         struct qreg src_blend[4], dst_blend[4];
         for (int i = 0; i < 3; i++) {