vkd3d-shader/hlsl: Remove redundant type check in declare_vars().

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Francisco Casas 2022-03-10 12:14:11 -03:00 committed by Alexandre Julliard
parent 84059d61c3
commit a7e6d6b9d2

View File

@ -1612,23 +1612,17 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
continue;
}
if (type->type == HLSL_CLASS_STRUCT)
{
struct_var_initializer(ctx, statements_list, var, &v->initializer);
vkd3d_free(v);
continue;
}
if (type->type > HLSL_CLASS_LAST_NUMERIC)
if (type->type > HLSL_CLASS_LAST_NUMERIC && type->type != HLSL_CLASS_STRUCT)
{
FIXME("Initializers for non scalar/struct variables not supported yet.\n");
free_parse_initializer(&v->initializer);
vkd3d_free(v);
continue;
}
if (v->arrays.count)
if (type->type == HLSL_CLASS_STRUCT)
{
hlsl_fixme(ctx, &v->loc, "Array initializer.");
free_parse_initializer(&v->initializer);
struct_var_initializer(ctx, statements_list, var, &v->initializer);
vkd3d_free(v);
continue;
}