diff options
author | Eric Anholt <[email protected]> | 2011-09-27 14:50:45 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-09-28 12:09:09 -0700 |
commit | 9f220bd1353b3d141d6a0308103ff403d8653e23 (patch) | |
tree | b42a6cd463947c0f00b79a3e3d0085af81aae736 /src/glsl/ir_constant_expression.cpp | |
parent | 158a5854502ce071e3f07d4ad9622b8ddb3c9859 (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; |