[Mesa-dev] [PATCH] glsl: Handle constant expressions involving ir_binop_equal/nequal.

Kenneth Graunke kenneth at whitecape.org
Wed Nov 9 01:04:56 PST 2011


Constant expressions which called GLSL's equal() and notEqual()
built-ins on bvecs would hit an assertion failure; we simply forgot to
implement them for booleans.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/ir_constant_expression.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 492be32..adca62e 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -713,6 +713,9 @@ ir_expression::constant_expression_value()
 	 case GLSL_TYPE_FLOAT:
 	    data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
 	    break;
+	 case GLSL_TYPE_BOOL:
+	    data.b[c] = op[0]->value.b[c] == op[1]->value.b[c];
+	    break;
 	 default:
 	    assert(0);
 	 }
@@ -731,6 +734,9 @@ ir_expression::constant_expression_value()
 	 case GLSL_TYPE_FLOAT:
 	    data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
 	    break;
+	 case GLSL_TYPE_BOOL:
+	    data.b[c] = op[0]->value.b[c] != op[1]->value.b[c];
+	    break;
 	 default:
 	    assert(0);
 	 }
-- 
1.7.7.2



More information about the mesa-dev mailing list