pan/midg: Fix midgard_pack_common_store_mask()
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 22 Apr 2021 10:21:31 +0000 (12:21 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 16:59:18 +0000 (16:59 +0000)
st_u64() gets an invalid mask when component Y is written.

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

src/panfrost/midgard/midgard_emit.c

index 53e227d..037e92a 100644 (file)
@@ -449,7 +449,7 @@ midgard_pack_common_store_mask(midgard_instruction *ins) {
                                         if (comp_sz == total_sz)
                                                 packed |= 0xF;
                                         else if (comp_sz == total_sz / 2)
-                                                packed |= 0x3 << i;
+                                                packed |= 0x3 << (i * 2);
                                         else if (comp_sz == total_sz / 4)
                                                 packed |= 0x1 << i;
                                 }