Mesa (master): ir_to_mesa: Don't assertion fail on remaining GLSL 1.30 ops.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Sep 28 19:15:01 UTC 2011
Module: Mesa
Branch: master
Commit: 1d59de1456ba55d32bbe0c0ae45a9358e31e1cd2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d59de1456ba55d32bbe0c0ae45a9358e31e1cd2
Author: Eric Anholt <eric at anholt.net>
Date: Tue Sep 27 14:26:02 2011 -0700
ir_to_mesa: Don't assertion fail on remaining GLSL 1.30 ops.
For hardware drivers, we only have ir_to_mesa called for the purposes
of potential swrast fallbacks (basically never on a 1.30 driver),
which we don't really care about. This will allow 1.30 to be
implemented without rewriting swrast for it.
Reviewed-by: Chad Versace <chad at chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/program/ir_to_mesa.cpp | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 7b2c69f..c5b71b3 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1456,14 +1456,22 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
emit_scalar(ir, OPCODE_POW, result_dst, op[0], op[1]);
break;
- case ir_unop_bit_not:
+ /* GLSL 1.30 integer ops are unsupported in Mesa IR, but since
+ * hardware backends have no way to avoid Mesa IR generation
+ * even if they don't use it, we need to emit "something" and
+ * continue.
+ */
case ir_binop_lshift:
case ir_binop_rshift:
case ir_binop_bit_and:
case ir_binop_bit_xor:
case ir_binop_bit_or:
+ emit(ir, OPCODE_ADD, result_dst, op[0], op[1]);
+ break;
+
+ case ir_unop_bit_not:
case ir_unop_round_even:
- assert(!"GLSL 1.30 features unsupported");
+ emit(ir, OPCODE_MOV, result_dst, op[0]);
break;
case ir_quadop_vector:
More information about the mesa-commit
mailing list