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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17117>
(cherry picked from commit 6cbb19110b)
This commit is contained in:
Filip Gawin 2022-06-18 13:57:14 +02:00 committed by Dylan Baker
parent 683d224329
commit d3050e790f
2 changed files with 2 additions and 3 deletions

View file

@ -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
},

View file

@ -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;