aco: ensure that uniform booleans are computed in WQM if their uses happen in WQM
authorDaniel Schürmann <daniel@schuermann.dev>
Wed, 16 Oct 2019 10:56:05 +0000 (12:56 +0200)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 21 Oct 2019 17:39:46 +0000 (17:39 +0000)
This fixes graphical corruption in SC2.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
src/amd/compiler/aco_instruction_selection.cpp

index fede0979bd2b93a4fa68eb400fafe18bc395036d..203897d0d8f3008453f45072390fd871061f3b7b 100644 (file)
@@ -321,7 +321,8 @@ Temp as_uniform_bool(isel_context *ctx, Temp val)
    } else {
       assert(val.regClass() == s2);
       Builder bld(ctx->program, ctx->block);
-      return bld.sopc(aco_opcode::s_cmp_lg_u64, bld.def(s1, scc), Operand(0u), Operand(val));
+      /* if we're currently in WQM mode, ensure that the source is also computed in WQM */
+      return bld.sopc(aco_opcode::s_cmp_lg_u64, bld.def(s1, scc), Operand(0u), emit_wqm(ctx, val));
    }
 }