i965: When splitting vector variable assignment, ignore unset channels.
authorEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:40:40 +0000 (14:40 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:55:58 +0000 (14:55 -0700)
The new checks for sanity in ir_assignment creation got angry about
this write_mask == 0.  Fixes:
glsl-fs-dot-vec2.
glsl-fs-atan-2
glsl-fs-dot-vec2

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

index d4da86b3b06d2a32d9f29f7ba3a499f101b07c8c..9b58916cf2b065e4cea4720d62dec9ae2ec88647 100644 (file)
@@ -271,12 +271,15 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
         void *mem_ctx = lhs ? lhs->mem_ctx : rhs->mem_ctx;
         unsigned int writemask;
 
+        if (!(ir->write_mask & (1 << i)))
+           continue;
+
         if (lhs) {
            new_lhs = new(mem_ctx) ir_dereference_variable(lhs->components[i]);
-           writemask = (ir->write_mask >> i) & 1;
+           writemask = 1;
         } else {
            new_lhs = ir->lhs->clone(mem_ctx, NULL);
-           writemask = ir->write_mask & (1 << i);
+           writemask = 1 << i;
         }
 
         if (rhs) {