pan/mdg: Fix type checking issues with compute
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 13 May 2020 15:05:34 +0000 (11:05 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
SSBO and barriers.

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

src/panfrost/midgard/midgard_address.c
src/panfrost/midgard/midgard_compile.c

index 7b8e01811d2bc9264afabe14d3bd799c8f6651a8..c0d1777551708b975796dafcfeeba95dfa50364d 100644 (file)
@@ -178,6 +178,7 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
         if (!offset->is_ssa) {
                 ins->load_store.arg_1 |= is_shared ? 0x6E : 0x7E;
                 ins->src[2] = nir_src_index(ctx, offset);
+                ins->src_types[2] = nir_type_uint | nir_src_bit_size(*offset);
                 return;
         }
 
@@ -186,12 +187,14 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
         if (match.A.def) {
                 ins->src[1] = nir_ssa_index(match.A.def);
                 ins->swizzle[1][0] = match.A.comp;
+                ins->src_types[1] = nir_type_uint | match.A.def->bit_size;
         } else
                 ins->load_store.arg_1 |= is_shared ? 0x6E : 0x7E;
 
         if (match.B.def) {
                 ins->src[2] = nir_ssa_index(match.B.def);
                 ins->swizzle[2][0] = match.B.comp;
+                ins->src_types[2] = nir_type_uint | match.B.def->bit_size;
         } else
                 ins->load_store.arg_2 = 0x1E;
 
index 1ca2df891f63d8515cc4a268e78722bc7cc68283..03829a6427e9980c2cdd1d3ee4939054c01bca17 100644 (file)
@@ -1388,6 +1388,7 @@ emit_control_barrier(compiler_context *ctx)
 {
         midgard_instruction ins = {
                 .type = TAG_TEXTURE_4,
+                .dest = ~0,
                 .src = { ~0, ~0, ~0, ~0 },
                 .texture = {
                         .op = TEXTURE_OP_BARRIER,