pan/midgard: Fix texw lowering with complex control flow
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 15 Aug 2019 21:23:05 +0000 (14:23 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 19 Aug 2019 15:32:17 +0000 (08:32 -0700)
Fixes shaders with control flow like:

   out = 0;

   if (A) {
      if (B)
         out = texture(A, ...)
   } else {
      out = texture(B, ...)
   }

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_ra.c

index 4754971acb2af79b8e59d0bd61d73cb0ab146953..5df8ecf0df06be973660e13f5a892a8c962a2796 100644 (file)
@@ -497,7 +497,7 @@ mir_lower_special_reads(compiler_context *ctx)
                                         midgard_instruction *use = mir_next_op(pre_use);
                                         assert(use);
                                         mir_insert_instruction_before(use, m);
-                                        mir_rewrite_index_dst_tag(ctx, i, idx, classes[j]);
+                                        mir_rewrite_index_dst_single(pre_use, i, idx);
                                 } else {
                                         idx = spill_idx++;
                                         m = v_mov(i, blank_alu_src, idx);