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 <currojerez@riseup.net>
This commit is contained in:
Jason Ekstrand
2016-03-23 14:30:29 -07:00
parent 89545b1314
commit ed3a029e80
+1 -1
View File
@@ -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)),