From d3050e790f850f42a27e1237d2f4d8405fb37590 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Sat, 18 Jun 2022 13:57:14 +0200 Subject: [PATCH] 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@functional@shaders@random@exponential@fragment@24 cc: mesa-stable Part-of: (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;