summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-21 17:39:47 -0700
committerKenneth Graunke <[email protected]>2010-07-28 15:46:27 -0700
commitf6ea9dfe473ccb0b5121461653696fe07ee4f328 (patch)
tree1edf967f4a99df773fba73084d460536cbb292c0 /src/glsl
parent3b6c29b8f00a2475b24022cace69f372b470a9b1 (diff)
ir_constant_expression: Add support for "acos" builtin.
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_constant_expression.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 2276f4d32e2..301bfa80251 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -817,6 +817,10 @@ ir_call::constant_expression_value()
return new(mem_ctx) ir_constant(true);
}
return new(mem_ctx) ir_constant(false);
+ } else if (strcmp(callee, "acos") == 0) {
+ assert(op[0]->type->is_float());
+ for (unsigned c = 0; c < op[0]->type->components(); c++)
+ data.f[c] = acosf(op[0]->value.f[c]);
} else if (strcmp(callee, "asin") == 0) {
assert(op[0]->type->is_float());
for (unsigned c = 0; c < op[0]->type->components(); c++)