diff --git a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py index 485943e16f2..f03b8eaf6bc 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py +++ b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py @@ -82,6 +82,11 @@ r300_nir_prepare_presubtract = [ (('fmul', 'a(is_ubo_or_input)', 2.0), ('fadd', a, a)), ] +for multiplier in [2.0, 4.0, 8.0, 16.0, 0.5, 0.25, 0.125, 0.0625]: + r300_nir_prepare_presubtract.extend([ + (('fmul', a, ('fmul(is_used_once)', 'b(is_ubo_or_input)', multiplier)), ('fmul', multiplier, ('fmul', a, b))), +]) + # Previous prepare_presubtract pass can sometimes produce double fneg patterns. # The backend copy propagate could handle it, but the nir to tgsi translation # does not and blows up. Just run a simple pass to clean it up.