projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b843c7a
)
ir_constant_visitor: Add support for dFdx and dFdy operations.
author
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 9 Jun 2010 22:22:35 +0000
(15:22 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Wed, 9 Jun 2010 22:23:40 +0000
(15:23 -0700)
If the argument is a constant expression...it's not changing per pixel,
so the result is simply 0.
ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/ir_constant_expression.cpp
b/ir_constant_expression.cpp
index e89b5bc7685304c56ce5119edacaeb188a869e7e..4055a84ff151d869353d885d35c90c64eb531957 100644
(file)
--- 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;