Module: Mesa Branch: 23.0 Commit: 0b4c673810b9aac83636c7384710d19605d8d851 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b4c673810b9aac83636c7384710d19605d8d851
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Jan 12 16:50:31 2023 -0500 pan/bi: Fix incorrect compilation of fsat(reg.yx) Future changes to nir_lower_blend cause fsat(reg.yx) instructions to be generated, which correspond to "FCLAMP.v2f16 x.h10" pseudoinstructions. These get their swizzles lowered, but we forgot to clear the swizzle out, so we end up with extra swap (cancelling out the intended swizzle). Fix the lowering logic. Fixes: ac636f5adb5 ("pan/bi: Use FCLAMP pseudo op for clamp prop") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683> (cherry picked from commit ed46c617b074c8e36670907ecf57f00bcf7bbc99) --- .pick_status.json | 2 +- src/panfrost/compiler/bi_lower_swizzle.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f8f80e51d01..0aa1dd8c4c8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -607,7 +607,7 @@ "description": "pan/bi: Fix incorrect compilation of fsat(reg.yx)", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ac636f5adb57704696c781a17f11609fad9035ec" }, diff --git a/src/panfrost/compiler/bi_lower_swizzle.c b/src/panfrost/compiler/bi_lower_swizzle.c index 5cc6ca2a21f..fb9fe079a9f 100644 --- a/src/panfrost/compiler/bi_lower_swizzle.c +++ b/src/panfrost/compiler/bi_lower_swizzle.c @@ -133,8 +133,10 @@ lower_swizzle(bi_context *ctx, bi_instr *ins, unsigned src) bi_index dest = ins->dest[0]; bi_index tmp = bi_temp(ctx); + bi_index swizzled_src = bi_replace_index(ins->src[0], tmp); + ins->src[0].swizzle = BI_SWIZZLE_H01; ins->dest[0] = tmp; - bi_swz_v2i16_to(&b, dest, bi_replace_index(ins->src[0], tmp)); + bi_swz_v2i16_to(&b, dest, swizzled_src); return; }
