projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
963df4d
)
glsl: Optimize -(-expr) into expr.
author
Matt Turner
<mattst88@gmail.com>
Wed, 16 Oct 2013 23:56:45 +0000
(16:56 -0700)
committer
Matt Turner
<mattst88@gmail.com>
Tue, 22 Oct 2013 05:53:36 +0000
(22:53 -0700)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/opt_algebraic.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/opt_algebraic.cpp
b/src/glsl/opt_algebraic.cpp
index 9b0596cd71a55aa79d20a61bd01c3f010c90f5b0..37b2f02c6e493d82c07dca86864085e2911e8af8 100644
(file)
--- a/
src/glsl/opt_algebraic.cpp
+++ b/
src/glsl/opt_algebraic.cpp
@@
-228,6
+228,16
@@
ir_algebraic_visitor::handle_expression(ir_expression *ir)
}
break;
+ case ir_unop_neg:
+ if (op_expr[0] == NULL)
+ break;
+
+ if (op_expr[0]->operation == ir_unop_neg) {
+ this->progress = true;
+ return swizzle_if_required(ir, op_expr[0]->operands[0]);
+ }
+ break;
+
case ir_unop_logic_not: {
enum ir_expression_operation new_op = ir_unop_logic_not;