diff options
-rw-r--r-- | src/glsl/nir/nir.h | 1 | ||||
-rw-r--r-- | src/glsl/nir/nir_opt_algebraic.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 6448d4a0f40..7be1abb5743 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1327,6 +1327,7 @@ typedef struct nir_function { exec_list_get_head(&(func)->overload_list), node) typedef struct nir_shader_compiler_options { + bool lower_ffma; bool lower_fpow; bool lower_fsqrt; /** lowers fneg and ineg to fsub and isub. */ diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index 8d5c03b0be7..83a02b6dad6 100644 --- a/src/glsl/nir/nir_opt_algebraic.py +++ b/src/glsl/nir/nir_opt_algebraic.py @@ -71,7 +71,8 @@ optimizations = [ (('flrp', a, b, 1.0), b), (('flrp', a, a, b), a), (('flrp', 0.0, a, b), ('fmul', a, b)), - (('fadd', ('fmul', a, b), c), ('ffma', a, b, c)), + (('ffma', a, b, c), ('fadd', ('fmul', a, b), c), 'options->lower_ffma'), + (('fadd', ('fmul', a, b), c), ('ffma', a, b, c), '!options->lower_ffma'), # Comparison simplifications (('inot', ('flt', a, b)), ('fge', a, b)), (('inot', ('fge', a, b)), ('flt', a, b)), |