From: Kenneth Graunke Date: Wed, 21 Jul 2010 23:57:10 +0000 (-0700) Subject: ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38cb1b273f55f98349d981445cfe06351322b032;p=mesa.git ir_constant_expression: Add support for builtins dFdx, dFdy, and fwidth. These always return zero (the derivative of a constant). --- diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index aa53d8d1867..641589ed077 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) {