From e68e519b910c2e1720bb1f8054a8f657f489086d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Fri, 27 Mar 2026 10:40:27 +0100 Subject: [PATCH] r300: fix bias presubtract algebraic transformation One fneg too many. Fixes: 0508db915 ("r300: implement bias presubtract") Part-of: --- src/gallium/drivers/r300/compiler/r300_nir_algebraic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py index 7b18911f6d3..1e1be554c36 100644 --- a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py +++ b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py @@ -53,8 +53,8 @@ r300_nir_prepare_presubtract = [ (('fadd', -1.0, a), ('fneg', ('fadd', 1.0, ('fneg', a)))), # Bias presubtract 1 - 2 * x expects MAD -a 2.0 1.0 form. (('ffma', 2.0, ('fneg', a), 1.0), ('ffma', ('fneg', a), 2.0, 1.0)), - (('ffma', a, -2.0, 1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))), - (('ffma', -2.0, a, 1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))), + (('ffma', a, -2.0, 1.0), ('ffma', ('fneg', a), 2.0, 1.0)), + (('ffma', -2.0, a, 1.0), ('ffma', ('fneg', a), 2.0, 1.0)), (('ffma', 2.0, a, -1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))), (('ffma', a, 2.0, -1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))), # x * 2 can be usually folded into output modifier for the previous