On Sun, Nov 16, 2014 at 5:51 PM, Thomas Helland <thomashellan...@gmail.com> wrote: > This allows the backend to decide if it does not > want saturates, or if it wants to combine min/max > together by itself. > > Usefull for drivers that implement saturate with min/max > as it can allow for some optimizations by min/max-pruning. > Drivers like freedreno and vc4 will benefit. > --- > I have not made any drivers set the option. > Probably some pipe-cap or something is needed > in gallium to allow this? > I could possibly find time to do a follow-up > patch for this if someone leads me in the right direction. > > saturate() in ir_builder generates ir_unop_saturate unconditionally. > If someone comes along later and does saturate() > in some optimization pass, whithout checking the options, > they will mess up possible optimizations for some backends. > The cleanest way I could find for always doing the right > thing was to write a lowering pass in opt_algebraic to > lower ir_unop_sature into max(min(x, 1), 0);
We already have that, so no need for work in that area :) See lower_instructions_visitor::sat_to_clamp(). _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev