diff options
author | Eric Anholt <eric@anholt.net> | 2010-05-07 12:20:58 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-24 15:05:20 -0700 |
commit | 4380099c98119611ceee684669d00be26195c7d7 (patch) | |
tree | 4ebb59390b8fa7fd334e3d0a95cd300e4316025c | |
parent | 763cd75863ed9a16912e585887580c44d1e8109f (diff) |
ir_to_mesa: Add logic_or and logic_and to get CorrectFunction1.vert working.
-rw-r--r-- | ir_to_mesa.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ir_to_mesa.cpp b/ir_to_mesa.cpp index 3ae848a21b..f45421057b 100644 --- a/ir_to_mesa.cpp +++ b/ir_to_mesa.cpp @@ -415,6 +415,19 @@ ir_to_mesa_visitor::visit(ir_expression *ir) this->result = this->create_tree(MB_TERM_sne_vec4_vec4, ir, op[0], op[1]); break; + case ir_binop_logic_or: + /* This could be a saturated add. */ + this->result = this->create_tree(MB_TERM_add_vec4_vec4, ir, op[0], op[1]); + this->result = this->create_tree(MB_TERM_sne_vec4_vec4, ir, + this->create_tree_for_float(ir, 0.0), + this->result); + break; + + case ir_binop_logic_and: + /* the bool args are stored as float 0.0 or 1.0, so "mul" gives us "and". */ + this->result = this->create_tree(MB_TERM_mul_vec4_vec4, ir, op[0], op[1]); + break; + case ir_binop_dot: if (ir->operands[0]->type == vec4_type) { assert(ir->operands[1]->type == vec4_type); |