mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 16:40:13 +01:00
nir/algebraic: Simplify max(abs(a), 0.0) -> abs(a)
This pattern was noticed in glmark's jellyfish scene. v2: Add inexact qualifier due to NaN behaviour. Minimal shader-db changes (slightly helped). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Elie Tournier <tournier.elie@gmail.com>
This commit is contained in:
parent
c9c1e26106
commit
d2d3cc66cf
1 changed files with 1 additions and 0 deletions
|
|
@ -399,6 +399,7 @@ optimizations = [
|
|||
(('imax', a, ('iabs', a)), ('iabs', a)),
|
||||
(('fmax', a, ('fneg', a)), ('fabs', a)),
|
||||
(('imax', a, ('ineg', a)), ('iabs', a)),
|
||||
(('~fmax', ('fabs', a), 0.0), ('fabs', a)),
|
||||
(('~fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
|
||||
(('~fmax', ('fmin', a, 1.0), 0.0), ('fsat', a), '!options->lower_fsat'),
|
||||
(('~fmin', ('fmax', a, -1.0), 0.0), ('fneg', ('fsat', ('fneg', a))), '!options->lower_negate && !options->lower_fsat'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue