summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-11-09 00:58:21 -0800
committerKenneth Graunke <kenneth@whitecape.org>2011-11-10 22:51:20 -0800
commita17a78a212be10fe3a9a330f3861d771e92d9074 (patch)
tree036a18004c1c3a15e65dae54f9fa10947ff3be4f /src
parent83d0514f1fc5f747a4bf4c900338a47a17f86e4a (diff)
glsl: Handle constant expressions involving ir_binop_equal/nequal.
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@whitecape.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir_constant_expression.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 492be325fb3..adca62e8d74 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);
}