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>
This commit is contained in:
Filip Gawin 2022-06-18 13:57:14 +02:00 committed by Marge Bot
parent b6a30b72ab
commit 6cbb19110b

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;