i965/vs: Fix abs/negate handling on attributes.
authorEric Anholt <eric@anholt.net>
Thu, 11 Aug 2011 23:27:41 +0000 (16:27 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Aug 2011 20:04:43 +0000 (13:04 -0700)
Fixes glsl-vs-neg-attribute and glsl-vs-abs-attribute.

src/mesa/drivers/dri/i965/brw_vec4_emit.cpp

index 9ef6ab6de908a10ecafee4532e50ac3151c95f15..6b0ae42e0e042d80c707a8e4ccad3770864a92fc 100644 (file)
@@ -65,9 +65,16 @@ vec4_visitor::setup_attributes(int payload_reg)
            continue;
 
         int grf = attribute_map[inst->src[i].reg + inst->src[i].reg_offset];
+
+        struct brw_reg reg = brw_vec8_grf(grf, 0);
+        reg.dw1.bits.swizzle = inst->src[i].swizzle;
+        if (inst->src[i].abs)
+           reg = brw_abs(reg);
+        if (inst->src[i].negate)
+           reg = negate(reg);
+
         inst->src[i].file = HW_REG;
-        inst->src[i].fixed_hw_reg = brw_vec8_grf(grf, 0);
-        inst->src[i].fixed_hw_reg.dw1.bits.swizzle = inst->src[i].swizzle;
+        inst->src[i].fixed_hw_reg = reg;
       }
    }