diff options
author | Eric Anholt <eric@anholt.net> | 2010-05-04 11:58:03 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-24 15:05:19 -0700 |
commit | b2ed4dd7b0270e469302965269007292117d02e2 (patch) | |
tree | b1bd9997e7fb1a6f375e78f70e21b81d4a0c95f8 /ir_to_mesa.cpp | |
parent | ae252d3613d10a051657c4ca6db27409f7cf40ae (diff) |
ir_to_mesa: Get temps allocated at the right times.
The alloced_vec4/vec4 distinction was an experiment to expose the cost
of temps to the codegen. But the problem is that the temporary
production rule gets called after the emit rule that was using the
temp. We could have the args to emit_op be pointers to where the temp
would get allocated later, but that seems overly hard while just
trying to bring this thing up. Besides, the temps used in expressions
bear only the vaguest relation to how many temps will be used after
register allocation.
Diffstat (limited to 'ir_to_mesa.cpp')
-rw-r--r-- | ir_to_mesa.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ir_to_mesa.cpp b/ir_to_mesa.cpp index f36dea5f31..eb55f82e27 100644 --- a/ir_to_mesa.cpp +++ b/ir_to_mesa.cpp @@ -293,6 +293,9 @@ ir_to_mesa_visitor::visit(ir_expression *ir) ir->accept(&v); exit(1); } + + /* Allocate a temporary for the result. */ + this->get_temp(this->result); } @@ -309,6 +312,7 @@ ir_to_mesa_visitor::visit(ir_swizzle *ir) assert(this->result); tree = this->create_tree(MB_TERM_swizzle_vec4, ir, this->result, NULL); + this->get_temp(tree); for (i = 0; i < 4; i++) { if (i < ir->type->vector_elements) { |