Mesa (glsl2): ir_to_mesa: Add support for assignment of aggregates.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jul 7 23:39:17 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 7d8091f7cca0314dd66599bdce5bfcf09fe8b578
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d8091f7cca0314dd66599bdce5bfcf09fe8b578
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jul 7 16:10:04 2010 -0700
ir_to_mesa: Add support for assignment of aggregates.
---
src/mesa/shader/ir_to_mesa.cpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index 00fa2cc..9497b17 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -1268,6 +1268,7 @@ ir_to_mesa_visitor::visit(ir_assignment *ir)
{
struct ir_to_mesa_dst_reg l;
struct ir_to_mesa_src_reg r;
+ int i;
assert(!ir->lhs->type->is_matrix());
assert(!ir->lhs->type->is_array());
@@ -1295,10 +1296,18 @@ ir_to_mesa_visitor::visit(ir_assignment *ir)
* an extra computing the condition.
*/
condition.negate = ~condition.negate;
- ir_to_mesa_emit_op3(ir, OPCODE_CMP, l,
- condition, r, ir_to_mesa_src_reg_from_dst(l));
+ for (i = 0; i < type_size(ir->lhs->type); i++) {
+ ir_to_mesa_emit_op3(ir, OPCODE_CMP, l,
+ condition, r, ir_to_mesa_src_reg_from_dst(l));
+ l.index++;
+ r.index++;
+ }
} else {
- ir_to_mesa_emit_op1(ir, OPCODE_MOV, l, r);
+ for (i = 0; i < type_size(ir->lhs->type); i++) {
+ ir_to_mesa_emit_op1(ir, OPCODE_MOV, l, r);
+ l.index++;
+ r.index++;
+ }
}
}
More information about the mesa-commit
mailing list