pan/bi: Relax check on 8bit swizzles
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 2 Jun 2021 08:17:55 +0000 (10:17 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 21 Sep 2021 12:58:54 +0000 (14:58 +0200)
Allow extracting components Y, Z or W from an 8bit vector.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>

src/panfrost/bifrost/bifrost_compile.c

index 16c1278..3c4cf10 100644 (file)
@@ -1445,8 +1445,8 @@ bi_alu_src_index(nir_alu_src src, unsigned comps)
         } else if (bitsize == 8) {
                 /* 8-bit vectors not yet supported */
                 assert(comps == 1 && "8-bit vectors not supported");
-                assert(src.swizzle[0] == 0 && "8-bit vectors not supported");
-                idx.swizzle = BI_SWIZZLE_B0000;
+                assert(src.swizzle[0] < 4 && "8-bit vectors not supported");
+                idx.swizzle = BI_SWIZZLE_B0000 + src.swizzle[0];
         }
 
         return idx;