Mesa (main): pan/bi: Change swizzled scalars to identity

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 6 23:43:27 UTC 2021


Module: Mesa
Branch: main
Commit: 3d78cc5876060015bfa277e2c3dfa424e599af1a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d78cc5876060015bfa277e2c3dfa424e599af1a

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue May  4 12:01:06 2021 -0400

pan/bi: Change swizzled scalars to identity

Allows packing for things like IADD.v2s16

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9239>

---

 src/panfrost/bifrost/bi_lower_swizzle.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/panfrost/bifrost/bi_lower_swizzle.c b/src/panfrost/bifrost/bi_lower_swizzle.c
index bae7739660d..5f396827fdf 100644
--- a/src/panfrost/bifrost/bi_lower_swizzle.c
+++ b/src/panfrost/bifrost/bi_lower_swizzle.c
@@ -77,7 +77,10 @@ bi_lower_swizzle_16(bi_context *ctx, bi_instr *ins, unsigned src)
         /* If the instruction is scalar we can ignore the other component */
         if (ins->dest[0].swizzle == BI_SWIZZLE_H00 &&
                         ins->src[src].swizzle == BI_SWIZZLE_H00)
+        {
+                ins->src[src].swizzle = BI_SWIZZLE_H01;
                 return;
+        }
 
         /* Lower it away */
         bi_builder b = bi_init_builder(ctx, bi_before_instr(ins));



More information about the mesa-commit mailing list