From: Kenneth Graunke Date: Thu, 22 Jul 2010 01:05:36 +0000 (-0700) Subject: ir_constant_expression: Add support for the "notEqual" builtin. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48a69ba05794f3d253114b452174710a15eefadf;p=mesa.git ir_constant_expression: Add support for the "notEqual" builtin. --- diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index e6f9558b62d..4a5eb7540a4 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -923,7 +923,22 @@ ir_call::constant_expression_value() } else if (strcmp(callee, "not") == 0) { expr = new(mem_ctx) ir_expression(ir_unop_logic_not, type, op[0], NULL); } else if (strcmp(callee, "notEqual") == 0) { - return NULL; /* FINISHME: implement this */ + assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector()); + for (unsigned c = 0; c < op[0]->type->components(); c++) { + switch (op[0]->type->base_type) { + case GLSL_TYPE_UINT: + data.b[c] = op[0]->value.u[c] != op[1]->value.u[c]; + break; + case GLSL_TYPE_INT: + data.b[c] = op[0]->value.i[c] != op[1]->value.i[c]; + break; + case GLSL_TYPE_FLOAT: + data.b[c] = op[0]->value.f[c] != op[1]->value.f[c]; + break; + default: + assert(!"Should not get here."); + } + } } else if (strcmp(callee, "outerProduct") == 0) { return NULL; /* FINISHME: implement this */ } else if (strcmp(callee, "pow") == 0) {