[Mesa-dev] [PATCH v2 2/7] glsl: Don't optimize min/max into saturate when EmitNoSat is set

Ian Romanick idr at freedesktop.org
Wed Dec 3 15:02:38 PST 2014


On 12/01/2014 05:47 AM, Abdiel Janulgue wrote:
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
> ---
>  src/glsl/opt_algebraic.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
> index 430f5cb..89fc0de 100644
> --- a/src/glsl/opt_algebraic.cpp
> +++ b/src/glsl/opt_algebraic.cpp
> @@ -679,7 +679,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
>  
>     case ir_binop_min:
>     case ir_binop_max:
> -      if (ir->type->base_type != GLSL_TYPE_FLOAT)
> +      if (ir->type->base_type != GLSL_TYPE_FLOAT ||
> +          options->EmitNoSat)

I think this will all fit on one line.

>           break;
>  
>        /* Replace min(max) operations and its commutative combinations with
> 



More information about the mesa-dev mailing list