From: Eric Anholt Date: Tue, 27 Sep 2011 21:50:45 +0000 (-0700) Subject: glsl: Add support for constant expression evaluation on trunc(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f220bd1353b3d141d6a0308103ff403d8653e23;p=mesa.git glsl: Add support for constant expression evaluation on trunc(). Fixes the glsl-1.30/compiler/built-in-functions/trunc-* tests under 1.30. Reviewed-by: Chad Versace Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 56a423761b5..b3fe6cf9675 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -1373,6 +1373,8 @@ ir_call::constant_expression_value() data.f[m*i+j] += op[0]->value.f[i+n*j]; } } + } else if (strcmp(callee, "trunc") == 0) { + expr = new(mem_ctx) ir_expression(ir_unop_trunc, op[0]); } else { /* Unsupported builtin - some are not allowed in constant expressions. */ return NULL;