From e06648d86a582b69608d5aa9db32a28d5729016b 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") (cherry picked from commit e68e519b910c2e1720bb1f8054a8f657f489086d) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/r300/compiler/r300_nir_algebraic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 12934eeeb55..4c3bcd621fd 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -704,7 +704,7 @@ "description": "r300: fix bias presubtract algebraic transformation", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "0508db91556242c57029ad538613c2b1ee1969ef", "notes": null diff --git a/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py b/src/gallium/drivers/r300/compiler/r300_nir_algebraic.py index f97275bfce9..37eeaf7ab49 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