summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-06-03 09:17:54 -0700
committerEric Anholt <eric@anholt.net>2010-06-24 15:05:21 -0700
commit9cd8cad9f3dc4774366193acbfc5ab22198096e7 (patch)
treed1cc6f4191cad0464fb8cc845503d56c10a93a9e
parent9d2b8e0b70acce2678bea2cb6a990e0dee380b37 (diff)
ir_to_mesa: Restrict dst writemasks like we did in the monoburg setup.
-rw-r--r--ir_to_mesa.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ir_to_mesa.cpp b/ir_to_mesa.cpp
index d9d7a91b29..8a5b2a6dbb 100644
--- a/ir_to_mesa.cpp
+++ b/ir_to_mesa.cpp
@@ -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: