From 1c5393d57d46e20612cee6c567421da10e0fcd48 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 11 Jan 2016 17:03:50 -0800 Subject: [PATCH] nir/spirv: Allow OpBranchConditional without a merge This can happen if you have a predicated break/continue. --- src/glsl/nir/spirv/vtn_cfg.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/glsl/nir/spirv/vtn_cfg.c b/src/glsl/nir/spirv/vtn_cfg.c index a927fb728c1..b3061ce47bb 100644 --- a/src/glsl/nir/spirv/vtn_cfg.c +++ b/src/glsl/nir/spirv/vtn_cfg.c @@ -325,12 +325,10 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list, list_addtail(&if_stmt->node.link, cf_list); - /* OpBranchConditional must be at the end of a block with either - * an OpSelectionMerge or an OpLoopMerge. - */ - assert(block->merge); - if ((*block->merge & SpvOpCodeMask) == SpvOpSelectionMerge) + if (block->merge && + (*block->merge & SpvOpCodeMask) == SpvOpSelectionMerge) { if_stmt->control = block->merge[2]; + } if_stmt->then_type = vtn_get_branch_type(then_block, switch_case, switch_break, -- 2.30.2