summaryrefslogtreecommitdiff
path: root/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-05-19 15:54:28 -0700
committerEric Anholt <eric@anholt.net>2010-06-24 15:05:20 -0700
commitc45b615a379e5b9cbcf951f9d738a1be77a5964b (patch)
treeb459f4b9095d55ea4c29f0fc98d008bf72fd17df /ir_to_mesa.cpp
parent3c5979565facebc82000a611b991d2977b8e9bbf (diff)
ir_to_mesa: Implement neg expression.
Diffstat (limited to 'ir_to_mesa.cpp')
-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 205e2fc8c9..722e93a797 100644
--- a/ir_to_mesa.cpp
+++ b/ir_to_mesa.cpp
@@ -47,7 +47,7 @@ extern "C" {
}
ir_to_mesa_src_reg ir_to_mesa_undef = {
- PROGRAM_UNDEFINED, 0, SWIZZLE_NOOP, false,
+ PROGRAM_UNDEFINED, 0, SWIZZLE_NOOP, NEGATE_NONE, false,
};
ir_to_mesa_dst_reg ir_to_mesa_undef_dst = {
@@ -184,6 +184,7 @@ ir_to_mesa_visitor::create_tree(int op,
tree->right = right;
tree->v = this;
tree->src_reg.swizzle = SWIZZLE_XYZW;
+ tree->src_reg.negate = 0;
tree->dst_reg.writemask = WRITEMASK_XYZW;
ir_to_mesa_set_tree_reg(tree, PROGRAM_UNDEFINED, 0);
tree->ir = ir;
@@ -418,6 +419,10 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
this->result = this->create_tree(MB_TERM_seq_vec4_vec4, ir,
op[0], this->result);
break;
+ case ir_unop_neg:
+ op[0]->src_reg.negate = ~op[0]->src_reg.negate;
+ this->result = op[0];
+ break;
case ir_unop_exp:
this->result = this->create_tree(MB_TERM_exp_vec4, ir, op[0], NULL);
break;