From 9f220bd1353b3d141d6a0308103ff403d8653e23 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Sep 2011 14:50:45 -0700 Subject: [PATCH] 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 --- src/glsl/ir_constant_expression.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.30.2