Mesa (staging/22.1): r300: prefer old not native swizzle in constant folding

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 16:19:36 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: d3050e790f850f42a27e1237d2f4d8405fb37590
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3050e790f850f42a27e1237d2f4d8405fb37590

Author: Filip Gawin <filip at gawin.net>
Date:   Sat Jun 18 13:57:14 2022 +0200

r300: prefer old not native swizzle in constant folding

r300 and r400 have strict rules with swizzles, so we
will need to convert swizzle back.

Operating on 0, 1, H in this case unnecessarily makes
rest of r300 overly complicated.
(also it's not currently able to handle this)

helps with:
deqp-gles2 at functional@shaders at random@exponential at fragment@24

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17117>
(cherry picked from commit 6cbb19110b4daa19e719228bdf2c1d7750ca0e4b)

---

 .pick_status.json                                   | 2 +-
 src/gallium/drivers/r300/compiler/radeon_optimize.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 62d091da9e9..2b6abcb794b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1219,7 +1219,7 @@
         "description": "r300: prefer old not native swizzle in constant folding",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c
index a7e9445ce11..04ee489265e 100644
--- a/src/gallium/drivers/r300/compiler/radeon_optimize.c
+++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c
@@ -396,8 +396,7 @@ static void constant_folding(struct radeon_compiler * c, struct rc_instruction *
 		}
 
 		/* don't make the swizzle worse */
-		if (!c->SwizzleCaps->IsNative(inst->U.I.Opcode, newsrc) &&
-		    c->SwizzleCaps->IsNative(inst->U.I.Opcode, inst->U.I.SrcReg[src]))
+		if (!c->SwizzleCaps->IsNative(inst->U.I.Opcode, newsrc))
 			continue;
 
 		inst->U.I.SrcReg[src] = newsrc;



More information about the mesa-commit mailing list