aco: fix read_invocation with VGPR lane index
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 12 Nov 2019 15:44:17 +0000 (15:44 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 12 Nov 2019 17:21:38 +0000 (17:21 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 93c8ebfa ('aco: Initial commit of independent AMD compiler')
src/amd/compiler/aco_instruction_selection.cpp

index f616da9d88d9930c9a19e2ac9712f8b05db3bdcc..cdedb51654262dc3aad742caba88cf87f7a72487 100644 (file)
@@ -5626,9 +5626,8 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr)
    }
    case nir_intrinsic_read_invocation: {
       Temp src = get_ssa_temp(ctx, instr->src[0].ssa);
-      Temp lane = get_ssa_temp(ctx, instr->src[1].ssa);
+      Temp lane = bld.as_uniform(get_ssa_temp(ctx, instr->src[1].ssa));
       Temp dst = get_ssa_temp(ctx, &instr->dest.ssa);
-      assert(lane.regClass() == s1);
       if (src.regClass() == v1) {
          emit_wqm(ctx, bld.vop3(aco_opcode::v_readlane_b32, bld.def(s1), src, lane), dst);
       } else if (src.regClass() == v2) {