Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.c:
struct hlsl_block *body, const struct vkd3d_shader_location *loc)
+{
- struct hlsl_ir_switch_case *c;
- if (!(c = hlsl_alloc(ctx, sizeof(*c))))
return NULL;
- if (value)
- {
c->value = hlsl_evaluate_static_expression_as_uint(ctx, value, loc);
- }
- else
- {
c->is_default = true;
- }
I... guess, but this is kind of contrary to the way we usually do these things, and having hlsl.c call hlsl.y is kind of a layering violation. I'd rather just see us interpret the value in hlsl.y and pass it to hlsl_new_switch_case(). That will also make clone_switch() less awkward.