X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fspirv%2Fvtn_cfg.c;h=a1573565b81eb6c13275c0fd76efdfe023370c50;hb=57fba85da408dd4ec98508b5106c156d616b5602;hp=074f61b331e90748c2b9b1b4b98ff553505e3f61;hpb=b41e74ae4a7c8f67c47149b4415f715f8a4d2597;p=mesa.git diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 074f61b331e..a1573565b81 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -24,6 +24,7 @@ #include "vtn_private.h" #include "spirv_info.h" #include "nir/nir_vla.h" +#include "util/debug.h" static struct vtn_block * vtn_block(struct vtn_builder *b, uint32_t value_id) @@ -1164,6 +1165,13 @@ vtn_emit_cf_list_structured(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);