diff options
author | marha <marha@users.sourceforge.net> | 2013-10-24 08:15:59 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-24 08:15:59 +0200 |
commit | 285b1bd8933288fc56259cfb3de61207c8e35d9e (patch) | |
tree | 2107aaa7f683f16a9a1a73e5f6f2d7ba53710f32 /mesalib/src/glsl/opt_algebraic.cpp | |
parent | c665b6e88274f8bc603b0f14f92bf09d2023bd4d (diff) | |
parent | 4eb0b643ad978d94837e2d587a5d4358f974a25c (diff) | |
download | vcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.tar.gz vcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.tar.bz2 vcxsrv-285b1bd8933288fc56259cfb3de61207c8e35d9e.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig mesa xserver git update 24 oct 2013
Conflicts:
xorg-server/glx/glxdricommon.c
Diffstat (limited to 'mesalib/src/glsl/opt_algebraic.cpp')
-rw-r--r-- | mesalib/src/glsl/opt_algebraic.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp index 3e5802e18..37b2f02c6 100644 --- a/mesalib/src/glsl/opt_algebraic.cpp +++ b/mesalib/src/glsl/opt_algebraic.cpp @@ -210,6 +210,34 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) this->mem_ctx = ralloc_parent(ir); switch (ir->operation) { + case ir_unop_abs: + if (op_expr[0] == NULL) + break; + + switch (op_expr[0]->operation) { + case ir_unop_abs: + case ir_unop_neg: + this->progress = true; + temp = new(mem_ctx) ir_expression(ir_unop_abs, + ir->type, + op_expr[0]->operands[0], + NULL); + return swizzle_if_required(ir, temp); + default: + break; + } + 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; @@ -257,11 +285,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; case ir_binop_sub: @@ -315,11 +341,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) * constant folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; |