aco: set has_divergent_branch for discards in loops

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>
This commit is contained in:
Rhys Perry 2020-01-31 12:40:51 +00:00 committed by Marge Bot
parent 8bc3d6574c
commit f1a2e1df78
1 changed files with 3 additions and 0 deletions

View File

@ -4462,6 +4462,9 @@ void visit_discard(isel_context* ctx, nir_intrinsic_instr *instr)
ctx->block->kind |= block_kind_break;
unsigned idx = ctx->block->index;
ctx->cf_info.parent_loop.has_divergent_branch = true;
ctx->cf_info.nir_to_aco[instr->instr.block->index] = idx;
/* remove critical edges from linear CFG */
bld.branch(aco_opcode::p_branch);
Block* break_block = ctx->program->create_and_insert_block();