From 6eadde51bba26bc57da7b26cbb40d783259d4a5f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Jan 2015 14:10:58 -0800 Subject: [PATCH] nir: Recognize and reduce duplicated fsats. No effect on vc4 shader-db. v2: Rebase to master (no TGSI->NIR present) Reviewed-by: Kenneth Graunke (v1) --- src/glsl/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index c7cb651fbb4..504c9f69054 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt_algebraic.py @@ -87,6 +87,8 @@ optimizations = [ (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)), (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'), (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'), + (('fsat', ('fsat', a)), ('fsat', a)), + (('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)), # Comparison with the same args. Note that these are not done for # the float versions because NaN always returns false on float # inequalities. -- 2.30.2