pan/mdg: Include more types
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 7 May 2020 17:43:13 +0000 (13:43 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>

src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_opt_perspective.c
src/panfrost/midgard/mir.c

index fdcd4c7a8bb8abd38e80cbe31416b0b5a5edb730..1bc93fc441ca2023d204f198d7b224ecdf6dbafe 100644 (file)
@@ -554,6 +554,7 @@ v_load_store_scratch(
         midgard_instruction ins = {
                 .type = TAG_LOAD_STORE_4,
                 .mask = mask,
+                .dest_type = nir_type_uint32,
                 .dest = ~0,
                 .src = { ~0, ~0, ~0, ~0 },
                 .swizzle = SWIZZLE_IDENTITY_4,
@@ -573,6 +574,7 @@ v_load_store_scratch(
 
         if (is_store) {
                 ins.src[0] = srcdest;
+                ins.src_types[0] = nir_type_uint32;
 
                 /* Ensure we are tightly swizzled so liveness analysis is
                  * correct */
index 4a387010981d5ea09458f0b9980b487d647fc113..1d6d4a04fcac64e1f267913277897934465dc5f7 100644 (file)
@@ -1588,8 +1588,10 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
                                 ld.load_store.arg_2 = 0x1E;
                         }
 
-                        for (unsigned c = 2; c < 16; ++c)
+                        for (unsigned c = 4; c < 16; ++c)
                                 ld.swizzle[0][c] = 0;
+
+                        ld.dest_type = nir_type_float16;
                 }
 
                 emit_mir_instruction(ctx, ld);
index 4af8c45356e9b07c8163c32c43b13bff94f682b7..8019246bab0cd467f4fa431bba32ccf20c71e044 100644 (file)
@@ -116,7 +116,9 @@ midgard_opt_combine_projection(compiler_context *ctx, midgard_block *block)
                         .type = TAG_LOAD_STORE_4,
                         .mask = ins->mask,
                         .dest = to,
+                        .dest_type = nir_type_float32,
                         .src = { frcp_from, ~0, ~0, ~0 },
+                        .src_types = { nir_type_float32 },
                         .swizzle = SWIZZLE_IDENTITY_4,
                         .load_store = {
                                 .op = frcp_component == COMPONENT_W ?
index e77908947ed5fd4579922ba3b14aad823cd43e99..9651f12bf65444449b40277554f871600e0eda55 100644 (file)
@@ -440,6 +440,10 @@ mir_flip(midgard_instruction *ins)
         ins->alu.src1 = ins->alu.src2;
         ins->alu.src2 = temp;
 
+        temp = ins->src_types[0];
+        ins->src_types[0] = ins->src_types[1];
+        ins->src_types[1] = temp;
+
         unsigned temp_swizzle[16];
         memcpy(temp_swizzle, ins->swizzle[0], sizeof(ins->swizzle[0]));
         memcpy(ins->swizzle[0], ins->swizzle[1], sizeof(ins->swizzle[0]));