summaryrefslogtreecommitdiff
path: root/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-31 21:09:02 -1000
committerIan Romanick <ian.d.romanick@intel.com>2010-04-02 11:22:41 -0700
commit528bb853599f514611e8e49adc758662219dacf7 (patch)
tree074fbc9d6d14e1e9c00e8c7469c3e5e2ae90e148 /ir_constant_expression.cpp
parentebbf14b9801d577adf40dcb0b63df2d3b8da934e (diff)
Handle logic not in constant expression evaluation.
Diffstat (limited to 'ir_constant_expression.cpp')
-rw-r--r--ir_constant_expression.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/ir_constant_expression.cpp b/ir_constant_expression.cpp
index 942bd8097e..c7c4d7b244 100644
--- a/ir_constant_expression.cpp
+++ b/ir_constant_expression.cpp
@@ -135,6 +135,13 @@ ir_constant_visitor::visit(ir_expression *ir)
ir_constant *op[2];
switch (ir->operation) {
+ case ir_unop_logic_not:
+ op[0] = ir->operands[0]->constant_expression_value();
+ if (op[0]) {
+ value = new ir_constant(!op[0]->value.b[0]);
+ value->type = glsl_type::bool_type;
+ }
+ break;
case ir_binop_mul:
op[0] = ir->operands[0]->constant_expression_value();
op[1] = ir->operands[1]->constant_expression_value();