From: Eric Anholt Date: Thu, 1 Apr 2010 07:09:02 +0000 (-1000) Subject: Handle logic not in constant expression evaluation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=528bb853599f514611e8e49adc758662219dacf7;p=mesa.git Handle logic not in constant expression evaluation. --- diff --git a/ir_constant_expression.cpp b/ir_constant_expression.cpp index 942bd8097e1..c7c4d7b2449 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();