From b9919b9980fb1c925c463e1c16b278a7ab003d75 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Mon, 19 Sep 2022 13:35:13 -0700 Subject: [PATCH] spirv: Pass vtn_block into vtn_emit_branch() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will be used later to handle branches instructions that have parameters in them, e.g. SpvOpEmitMeshTasksEXT. No behavior change in this commit. Reviewed-by: Jason Ekstrand Reviewed-by: Timur Kristóf Part-of: --- src/compiler/spirv/vtn_cfg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 4b1d66550b3..9215bc86dae 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -975,6 +975,7 @@ vtn_handle_phi_second_pass(struct vtn_builder *b, SpvOp opcode, static void vtn_emit_branch(struct vtn_builder *b, enum vtn_branch_type branch_type, + const struct vtn_block *block, nir_variable *switch_fall_var, bool *has_switch_break) { switch (branch_type) { @@ -1120,7 +1121,7 @@ vtn_emit_cf_list_structured(struct vtn_builder *b, struct list_head *cf_list, vtn_emit_ret_store(b, block); if (block->branch_type != vtn_branch_type_none) { - vtn_emit_branch(b, block->branch_type, + vtn_emit_branch(b, block->branch_type, block, switch_fall_var, has_switch_break); return; } @@ -1142,7 +1143,7 @@ vtn_emit_cf_list_structured(struct vtn_builder *b, struct list_head *cf_list, vtn_emit_cf_list_structured(b, &vtn_if->then_body, switch_fall_var, &sw_break, handler); } else { - vtn_emit_branch(b, vtn_if->then_type, switch_fall_var, &sw_break); + vtn_emit_branch(b, vtn_if->then_type, NULL, switch_fall_var, &sw_break); } break; } @@ -1156,7 +1157,7 @@ vtn_emit_cf_list_structured(struct vtn_builder *b, struct list_head *cf_list, vtn_emit_cf_list_structured(b, &vtn_if->then_body, switch_fall_var, &sw_break, handler); } else { - vtn_emit_branch(b, vtn_if->then_type, switch_fall_var, &sw_break); + vtn_emit_branch(b, vtn_if->then_type, NULL, switch_fall_var, &sw_break); } nir_push_else(&b->nb, nif); @@ -1164,7 +1165,7 @@ vtn_emit_cf_list_structured(struct vtn_builder *b, struct list_head *cf_list, vtn_emit_cf_list_structured(b, &vtn_if->else_body, switch_fall_var, &sw_break, handler); } else { - vtn_emit_branch(b, vtn_if->else_type, switch_fall_var, &sw_break); + vtn_emit_branch(b, vtn_if->else_type, NULL, switch_fall_var, &sw_break); } nir_pop_if(&b->nb, nif);