diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-09 15:22:35 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-06-09 15:23:40 -0700 |
commit | d6a32d4b5450d76046428fd3f93a4feb0d14b5e6 (patch) | |
tree | c2e8ab8af29c589ce921d3f463aaac5557d42ace /ir_constant_expression.cpp | |
parent | b843c7a20c2d65494f30eb82622ae7db380f581a (diff) |
ir_constant_visitor: Add support for dFdx and dFdy operations.
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
Diffstat (limited to 'ir_constant_expression.cpp')
-rw-r--r-- | ir_constant_expression.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ir_constant_expression.cpp b/ir_constant_expression.cpp index e89b5bc768..4055a84ff1 100644 --- a/ir_constant_expression.cpp +++ b/ir_constant_expression.cpp @@ -266,6 +266,15 @@ ir_constant_visitor::visit(ir_expression *ir) } break; + case ir_unop_dFdx: + case ir_unop_dFdy: + assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); + type = ir->type; + for (c = 0; c < ir->operands[0]->type->components(); c++) { + f[c] = 0.0; + } + break; + case ir_binop_add: if (ir->operands[0]->type == ir->operands[1]->type) { type = ir->operands[0]->type; |