Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_codegen.c:
terminal_break = false;node = LIST_ENTRY(list_tail(&c->body.instrs), struct hlsl_ir_node, entry);if (node->type == HLSL_IR_JUMP){jump = hlsl_ir_jump(node);terminal_break = jump->type == HLSL_IR_JUMP_BREAK;}if (!terminal_break)break;- }
- if (!terminal_break)
- {
hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX,"Switch case statement should end with a 'break'.");
Also `return` is valid. We don't have to care about it because by the time this is executed a `return` inside a `switch` has already become a `break`, but the error message should mention it anyway.