summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_opt_algebraic.py
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-30 13:53:39 -0800
committerEric Anholt <[email protected]>2015-02-18 14:47:51 -0800
commit1907a3a7ee4d756b12b6fef32a6e5ea7656436d1 (patch)
tree5a21b2bed219ca6f92e56ce899f3060a25bdf754 /src/glsl/nir/nir_opt_algebraic.py
parente5ecf8e4272522e1950d1d4318df19377bf49ae1 (diff)
nir: Add a flag for lowering fsat.
vc4 cse/algebraic-disabled stats: total instructions in shared programs: 44356 -> 44354 (-0.00%) instructions in affected programs: 55 -> 53 (-3.64%) v2: Rebase to master (no TGSI->NIR present) Reviewed-by: Kenneth Graunke <[email protected]> (v1)
Diffstat (limited to 'src/glsl/nir/nir_opt_algebraic.py')
-rw-r--r--src/glsl/nir/nir_opt_algebraic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index 83a02b6dad6..c7cb651fbb4 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -85,7 +85,8 @@ optimizations = [
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
(('bcsel', ('flt', a, b), a, b), ('fmin', a, b)),
(('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
- (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a)),
+ (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
+ (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
# Comparison with the same args. Note that these are not done for
# the float versions because NaN always returns false on float
# inequalities.