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 <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt
2011-09-27 14:50:45 -07:00
parent 158a585450
commit 9f220bd135

View File

@@ -1373,6 +1373,8 @@ ir_call::constant_expression_value()
data.f[m*i+j] += op[0]->value.f[i+n*j]; 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 { } else {
/* Unsupported builtin - some are not allowed in constant expressions. */ /* Unsupported builtin - some are not allowed in constant expressions. */
return NULL; return NULL;