pan/bi: Implement jumps with the builder

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135>
This commit is contained in:
Alyssa Rosenzweig 2020-12-11 22:33:09 -05:00 committed by Marge Bot
parent f05174e5a5
commit 311d3d6015
1 changed files with 20 additions and 0 deletions

View File

@ -70,6 +70,26 @@ bi_init_builder(bi_context *ctx)
static bi_block *emit_cf_list(bi_context *ctx, struct exec_list *list);
static bi_instruction *bi_emit_branch(bi_context *ctx);
static void
bi_emit_jump(bi_builder *b, nir_jump_instr *instr)
{
bi_instr *branch = bi_jump_to(b, bi_null(), bi_zero());
switch (instr->type) {
case nir_jump_break:
branch->branch_target = b->shader->break_block;
break;
case nir_jump_continue:
branch->branch_target = b->shader->continue_block;
break;
default:
unreachable("Unhandled jump type");
}
pan_block_add_successor(&b->shader->current_block->base, &branch->branch_target->base);
b->shader->current_block->base.unconditional_jumps = true;
}
static void
emit_jump(bi_context *ctx, nir_jump_instr *instr)
{