summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/spirv/vtn_cfg.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 4a07b35be53..3f157db009b 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -1285,6 +1285,13 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
vtn_foreach_cf_node(case_node, &vtn_switch->cases) {
struct vtn_case *cse = vtn_cf_node_as_case(case_node);
+ /* If this case jumps directly to the break block, we don't have
+ * to handle the case as the body is empty and doesn't fall
+ * through.
+ */
+ if (cse->block == vtn_switch->break_block)
+ continue;
+
/* Figure out the condition */
nir_ssa_def *cond =
vtn_switch_case_condition(b, vtn_switch, sel, cse);