pan/midgard: Fix mir_mask_of_read_components with dot products
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 15 Oct 2019 20:49:37 +0000 (16:49 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 16 Oct 2019 01:41:12 +0000 (21:41 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/mir.c

index b9df0527e3faa6121f412160aada510f0cc55199..5d49f7f79f1aaeb6888221e195b86a04fb44789c 100644 (file)
@@ -411,19 +411,19 @@ mir_mask_of_read_components(midgard_instruction *ins, unsigned node)
                  * readmasks based on the writemask */
                 unsigned qmask = (ins->type == TAG_ALU_4) ? ins->mask : 0xF;
 
-                unsigned swizzle = mir_get_swizzle(ins, i);
-                unsigned m = mir_mask_of_read_components_single(swizzle, qmask);
-
                 /* Handle dot products and things */
                 if (ins->type == TAG_ALU_4 && !ins->compact_branch) {
                         unsigned channel_override =
                                 GET_CHANNEL_COUNT(alu_opcode_props[ins->alu.op].props);
 
                         if (channel_override)
-                                m = mask_of(channel_override);
+                                qmask = mask_of(channel_override);
                 }
 
-                mask |= m;
+                unsigned swizzle = mir_get_swizzle(ins, i);
+                unsigned m = mir_mask_of_read_components_single(swizzle, qmask);
+
+               mask |= m;
         }
 
         return mask;