aco: Fix NGG GS assert failure from the WG scan.

There was a temp which was defined in a branch but used outside,
without a phi.

Fixes: 62b5012ec3
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7817>
This commit is contained in:
Timur Kristóf
2020-11-27 21:31:50 +01:00
committed by Marge Bot
parent c2974a1d45
commit 94f8cb29ee

View File

@@ -11375,11 +11375,11 @@ std::pair<Temp, Temp> ngg_gs_workgroup_reduce_and_scan(isel_context *ctx, Temp s
/* Determine if the current lane is the first. */
Temp is_first_lane = bld.copy(bld.def(bld.lm), Operand(1u, ctx->program->wave_size == 64));
Temp wave_id_in_tg = wave_id_in_threadgroup(ctx);
begin_divergent_if_then(ctx, &ic, is_first_lane);
bld.reset(ctx->block);
/* The first lane of each wave stores the result of its subgroup reduction to LDS (NGG scratch). */
Temp wave_id_in_tg = wave_id_in_threadgroup(ctx);
Temp wave_id_in_tg_lds_addr = bld.vop2_e64(aco_opcode::v_lshlrev_b32, bld.def(v1), Operand(2u), wave_id_in_tg);
store_lds(ctx, 4u, as_vgpr(ctx, sg_reduction), 0x1u, wave_id_in_tg_lds_addr, ctx->ngg_gs_scratch_addr, 4u);