14 Feb
2023
14 Feb
'23
6:25 p.m.
Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.c:
return names[type]; }
+const char *hlsl_jump_type_to_string(enum hlsl_ir_jump_type type) +{ + static const char * const names[] = + { + "HLSL_IR_JUMP_BREAK", + "HLSL_IR_JUMP_CONTINUE", + "HLSL_IR_JUMP_DISCARD", + "HLSL_IR_JUMP_RETURN", + }; + + if (type >= ARRAY_SIZE(names)) + return "Unexpected jump type";
I'd just make this an assert honestly? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/92#note_24090