summaryrefslogtreecommitdiff
path: root/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-07-21 16:57:10 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-07-28 15:46:26 -0700
commit38cb1b273f55f98349d981445cfe06351322b032 (patch)
treefbe9582d40eff0f6856c060e05ddaa79fe0c43e1 /src/glsl/ir_constant_expression.cpp
parent46d91615a2f6e1beaee98f40af957ba1a1a6b349 (diff)
ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth.
These always return zero (the derivative of a constant).
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r--src/glsl/ir_constant_expression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index aa53d8d186..641589ed07 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -812,7 +812,7 @@ ir_call::constant_expression_value()
} else if (strcmp(callee, "atan") == 0) {
return NULL; /* FINISHME: implement this */
} else if (strcmp(callee, "dFdx") == 0 || strcmp(callee, "dFdy") == 0) {
- return NULL; /* FINISHME: implement this */
+ return ir_constant::zero(mem_ctx, this->type);
} else if (strcmp(callee, "ceil") == 0) {
return NULL; /* FINISHME: implement this */
} else if (strcmp(callee, "clamp") == 0) {
@@ -842,7 +842,7 @@ ir_call::constant_expression_value()
} else if (strcmp(callee, "fract") == 0) {
return NULL; /* FINISHME: implement this */
} else if (strcmp(callee, "fwidth") == 0) {
- return NULL; /* FINISHME: implement this */
+ return ir_constant::zero(mem_ctx, this->type);
} else if (strcmp(callee, "greaterThan") == 0) {
return NULL; /* FINISHME: implement this */
} else if (strcmp(callee, "greaterThanEqual") == 0) {