Would this be conformant to GLSL spec if X had a runtime value of 0? Seems unsafe to replace X / X with 1 without a runtime test...maybe GLSL spec allows such optimizations.
On Thu, Aug 7, 2014 at 3:51 PM, <thomashellan...@gmail.com> wrote: > From: Thomas Helland <thomashellan...@gmail.com> > > Shows no changes for shader-db. > > Signed-off-by: Thomas Helland <thomashelland90 at gmail.com> > --- > src/glsl/opt_algebraic.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp > index 21bf332..a49752d 100644 > --- a/src/glsl/opt_algebraic.cpp > +++ b/src/glsl/opt_algebraic.cpp > @@ -513,6 +513,8 @@ ir_algebraic_visitor::handle_expression(ir_expression > *ir) > } > if (is_vec_one(op_const[1])) > return ir->operands[0]; > + if(ir->operands[0]->equals(ir->operands[1])) > + return new(mem_ctx) ir_constant(1.0f, 1); > break; > > case ir_binop_dot: > -- > 2.0.3 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev