i965: Fix the vector/expression splitting for the write_mask change.
authorEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:14:30 +0000 (14:14 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:15:27 +0000 (14:15 -0700)
+113 piglits.

src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp

index 478614090a012e249a1196a2ce62dc58565f173c..eba8a764e21d973630aae32835f7137fea7f6d08 100644 (file)
@@ -128,10 +128,7 @@ ir_channel_expressions_visitor::assign(ir_assignment *ir, int elem, ir_rvalue *v
     */
    assert(ir->write_mask == (1 << ir->lhs->type->components()) - 1);
 
-   /* Smear the float across all the channels for the masked write. */
-   val_swiz = new(mem_ctx) ir_swizzle(val, 0, 0, 0, 0,
-                                     ir->lhs->type->components());
-   assign = new(mem_ctx) ir_assignment(lhs, val_swiz, NULL, (1 << elem));
+   assign = new(mem_ctx) ir_assignment(lhs, val, NULL, (1 << elem));
    ir->insert_before(assign);
 }
 
index 00d5c202485701bf9840843a6a34bca464c9e330..d4da86b3b06d2a32d9f29f7ba3a499f101b07c8c 100644 (file)
@@ -281,9 +281,6 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
 
         if (rhs) {
            new_rhs = new(mem_ctx) ir_dereference_variable(rhs->components[i]);
-           /* If we're writing into a writemask, smear it out to that channel. */
-           if (!lhs)
-              new_rhs = new(mem_ctx) ir_swizzle(new_rhs, i, i, i, i, i + 1);
         } else {
            new_rhs = new(mem_ctx) ir_swizzle(ir->rhs->clone(mem_ctx, NULL),
                                              i, i, i, i, 1);