#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)
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);