ir_to_mesa: Restrict dst writemasks like we did in the monoburg setup.
authorEric Anholt <eric@anholt.net>
Thu, 3 Jun 2010 16:17:54 +0000 (09:17 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 24 Jun 2010 22:05:21 +0000 (15:05 -0700)
ir_to_mesa.cpp

index d9d7a91b29643f1a527cb2099162dd2c7579d732..8a5b2a6dbbb0cf01de858c7c4687e8a5cfd94e0b 100644 (file)
@@ -371,9 +371,14 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
    /* Storage for our result.  Ideally for an assignment we'd be using
     * the actual storage for the result here, instead.
     */
-   result_src = get_temp(4);
+   result_src = get_temp(ir->type->vector_elements);
    /* convenience for the emit functions below. */
    result_dst = ir_to_mesa_dst_reg_from_src(result_src);
+   /* Limit writes to the channels that will be used by result_src later.
+    * This does limit this temp's use as a temporary for multi-instruction
+    * sequences.
+    */
+   result_dst.writemask = (1 << ir->type->vector_elements) - 1;
 
    switch (ir->operation) {
    case ir_unop_logic_not: