Mesa (glsl2): ir_to_mesa: Fill in remaining ops, remove default case for expression types.
Eric Anholt
anholt at kemper.freedesktop.org
Thu Jul 1 18:27:51 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 411fb36b7cee223e090b4b9ef9bc14e058201a68
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=411fb36b7cee223e090b4b9ef9bc14e058201a68
Author: Eric Anholt <eric at anholt.net>
Date: Thu Jul 1 11:24:38 2010 -0700
ir_to_mesa: Fill in remaining ops, remove default case for expression types.
We should now have support for all the expression types we need for
GLSL 1.20.
---
src/mesa/shader/ir_to_mesa.cpp | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index dca2b10..1e18635 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -694,6 +694,9 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
ir_to_mesa_emit_scalar_op1(ir, OPCODE_RCP, result_dst, op[1]);
ir_to_mesa_emit_op2(ir, OPCODE_MUL, result_dst, op[0], result_src);
break;
+ case ir_binop_mod:
+ assert(!"ir_binop_mod should have been converted to b * fract(a/b)");
+ break;
case ir_binop_less:
ir_to_mesa_emit_op2(ir, OPCODE_SLT, result_dst, op[0], op[1]);
@@ -771,6 +774,7 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
ir_to_mesa_emit_op1(ir, OPCODE_TRUNC, result_dst, op[0]);
break;
case ir_unop_f2b:
+ case ir_unop_i2b:
ir_to_mesa_emit_op2(ir, OPCODE_SNE, result_dst,
result_src, src_reg_for_float(0.0));
break;
@@ -808,13 +812,6 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
case ir_binop_bit_or:
assert(!"GLSL 1.30 features unsupported");
break;
-
- default:
- ir_print_visitor v;
- printf("Failed to get tree for expression:\n");
- ir->accept(&v);
- exit(1);
- break;
}
this->result = result_src;
More information about the mesa-commit
mailing list