Mesa (master): aco: Fix NGG GS assert failure from the WG scan.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 1 15:14:46 UTC 2020


Module: Mesa
Branch: master
Commit: 94f8cb29ee7c615e74b4a85e14ac9e22c5dd7f2a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=94f8cb29ee7c615e74b4a85e14ac9e22c5dd7f2a

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Fri Nov 27 21:31:50 2020 +0100

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: 62b5012ec35358a7c109746bfe1da33ca1b04f24
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7817>

---

 src/amd/compiler/aco_instruction_selection.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index d4261628fd9..e98aa3fb8f4 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -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);
 



More information about the mesa-commit mailing list