Mesa (master): glsl: Fix assertion checking types of constant bitshift expressions.

Eric Anholt anholt at kemper.freedesktop.org
Wed Sep 28 19:15:01 UTC 2011


Module: Mesa
Branch: master
Commit: 344f94bb006188931b09939aafc7cc96609c4f5a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=344f94bb006188931b09939aafc7cc96609c4f5a

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 27 14:27:58 2011 -0700

glsl: Fix assertion checking types of constant bitshift expressions.

Bitshifts are one of the rare places that GLSL allows mixed base types
without an implicit conversion occurring.

Reviewed-by: Chad Versace <chad at chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/glsl/ir_constant_expression.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index f0299a2..56a4237 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -69,7 +69,9 @@ ir_expression::constant_expression_value()
    }
 
    if (op[1] != NULL)
-      assert(op[0]->type->base_type == op[1]->type->base_type);
+      assert(op[0]->type->base_type == op[1]->type->base_type ||
+	     this->operation == ir_binop_lshift ||
+	     this->operation == ir_binop_rshift);
 
    bool op0_scalar = op[0]->type->is_scalar();
    bool op1_scalar = op[1] != NULL && op[1]->type->is_scalar();




More information about the mesa-commit mailing list