From 15e6af070870b2d7105a90826dc9a4026e6f5846 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 18 Jan 2016 10:10:47 -0800 Subject: [PATCH] nir/spirv: Handle if's where the merge is also a break or continue --- src/glsl/nir/spirv/vtn_cfg.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/spirv/vtn_cfg.c b/src/glsl/nir/spirv/vtn_cfg.c index a57a44363dd..9c2e271cda1 100644 --- a/src/glsl/nir/spirv/vtn_cfg.c +++ b/src/glsl/nir/spirv/vtn_cfg.c @@ -351,8 +351,15 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list, switch_case, switch_break, loop_break, loop_cont, merge_block); - block = merge_block; - continue; + enum vtn_branch_type merge_type = + vtn_get_branch_type(merge_block, switch_case, switch_break, + loop_break, loop_cont); + if (merge_type == vtn_branch_type_none) { + block = merge_block; + continue; + } else { + return; + } } else if (if_stmt->then_type != vtn_branch_type_none && if_stmt->else_type != vtn_branch_type_none) { /* Both sides were short-circuited. We're done here. */ -- 2.30.2