diff options
author | Jason Ekstrand <[email protected]> | 2016-03-23 14:30:29 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-03-23 16:28:00 -0700 |
commit | ed3a029e8088cb17af073c3b5f7444cb7e2f1cfb (patch) | |
tree | 0328c5f8ef7594bcd4c955ad6e9975d93df2ef91 /src/compiler/nir/nir_opt_algebraic.py | |
parent | 89545b13141053cf12a10e5357aa82031e8419ed (diff) |
nir/algebraic: Fix fmin detection to match the spec
The previous transformation got the arguments to fmin backwards. When NaNs
are involved, the GLSL min/max aren't commutative so it matters.
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_algebraic.py')
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index ec6c6338bb1..7e3aa5aa798 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -122,7 +122,7 @@ optimizations = [ (('flt', 0.0, ('fabs', a)), ('fne', a, 0.0)), (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)), - (('bcsel', ('flt', a, b), a, b), ('fmin', a, b)), + (('bcsel', ('flt', b, a), b, a), ('fmin', a, b)), (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)), (('bcsel', ('inot', 'a@bool'), b, c), ('bcsel', a, c, b)), (('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)), |