diff options
author | marha <marha@users.sourceforge.net> | 2015-04-30 23:24:30 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-04-30 23:24:30 +0200 |
commit | a71d524ecad48837e0124a03124bc05f59a48be7 (patch) | |
tree | 87c5ba1711e03cb9692e23cc685b938571b52d76 /mesalib/src/glsl/opt_algebraic.cpp | |
parent | 2a00e489122f6c4b525090dbdba2855a2ea2d519 (diff) | |
download | vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.tar.gz vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.tar.bz2 vcxsrv-a71d524ecad48837e0124a03124bc05f59a48be7.zip |
fontconfig pixman libX11 mesa git update 30 Apr 2015
libX11 commit d3415d1f052530760b4617db45affcb984cfe35c
pixman commit e0c0153d8e5d42c08c2b9bd2cf2123bff2c48d75
fontconfig commit 4a6f5efd5f6a468e1872d58e589bcf30ba88e2fd
mesa commit 1ac7db07b363207e8ded9259f84bbcaa084b8667
Diffstat (limited to 'mesalib/src/glsl/opt_algebraic.cpp')
-rw-r--r-- | mesalib/src/glsl/opt_algebraic.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp index 3d2f2ca0b..fa5db70f2 100644 --- a/mesalib/src/glsl/opt_algebraic.cpp +++ b/mesalib/src/glsl/opt_algebraic.cpp @@ -99,6 +99,12 @@ is_vec_two(ir_constant *ir) } static inline bool +is_vec_four(ir_constant *ir) +{ + return (ir == NULL) ? false : ir->is_value(4.0, 4); +} + +static inline bool is_vec_negative_one(ir_constant *ir) { return (ir == NULL) ? false : ir->is_negative_one(); @@ -774,6 +780,20 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) return mul(x, x); } + if (is_vec_four(op_const[1])) { + ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x", + ir_var_temporary); + base_ir->insert_before(x); + base_ir->insert_before(assign(x, ir->operands[0])); + + ir_variable *squared = new(ir) ir_variable(ir->operands[1]->type, + "squared", + ir_var_temporary); + base_ir->insert_before(squared); + base_ir->insert_before(assign(squared, mul(x, x))); + return mul(squared, squared); + } + break; case ir_binop_min: |