i965: Fix destination writemasking in the new FS.
authorEric Anholt <eric@anholt.net>
Fri, 27 Aug 2010 18:05:47 +0000 (11:05 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 27 Aug 2010 19:02:15 +0000 (12:02 -0700)
src/mesa/drivers/dri/i965/brw_fs.cpp

index a73509f25885bc4956a8f28dbc0bb16728361a1a..a2284e431a0a792a43689e0008ea5a1cd188d50c 100644 (file)
@@ -832,12 +832,11 @@ fs_visitor::visit(ir_assignment *ir)
    }
 
    for (i = 0; i < type_size(ir->lhs->type); i++) {
-      if (i < 4 && !(write_mask & (1 << i)))
-        continue;
-
-      inst = emit(fs_inst(BRW_OPCODE_MOV, l, r));
-      if (ir->condition)
-        inst->predicated = true;
+      if (i >= 4 || (write_mask & (1 << i))) {
+        inst = emit(fs_inst(BRW_OPCODE_MOV, l, r));
+        if (ir->condition)
+           inst->predicated = true;
+      }
       l.reg_offset++;
       r.reg_offset++;
    }