mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Treat all braceless initializers as assignments.
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:
parent
6284cf7d57
commit
a75560af3d
@ -1602,12 +1602,12 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
|
||||
}
|
||||
|
||||
if (v->initializer.args_count)
|
||||
{
|
||||
if (v->initializer.braces)
|
||||
{
|
||||
unsigned int size = initializer_size(&v->initializer);
|
||||
struct hlsl_ir_load *load;
|
||||
|
||||
if (type->type <= HLSL_CLASS_LAST_NUMERIC && v->initializer.braces
|
||||
&& type->dimx * type->dimy != size)
|
||||
if (type->type <= HLSL_CLASS_LAST_NUMERIC && type->dimx * type->dimy != size)
|
||||
{
|
||||
hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_WRONG_PARAMETER_COUNT,
|
||||
"Expected %u components in numeric initializer, but got %u.",
|
||||
@ -1641,23 +1641,28 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
|
||||
vkd3d_free(v);
|
||||
continue;
|
||||
}
|
||||
if (v->initializer.args_count > 1)
|
||||
else
|
||||
{
|
||||
hlsl_fixme(ctx, &v->loc, "Complex initializer.");
|
||||
free_parse_initializer(&v->initializer);
|
||||
vkd3d_free(v);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
struct hlsl_ir_load *load = hlsl_new_var_load(ctx, var, var->loc);
|
||||
|
||||
load = hlsl_new_var_load(ctx, var, var->loc);
|
||||
assert(v->initializer.args_count == 1);
|
||||
list_add_tail(v->initializer.instrs, &load->node.entry);
|
||||
add_assignment(ctx, v->initializer.instrs, &load->node, ASSIGN_OP_ASSIGN, v->initializer.args[0]);
|
||||
vkd3d_free(v->initializer.args);
|
||||
}
|
||||
|
||||
if (modifiers & HLSL_STORAGE_STATIC)
|
||||
list_move_tail(&ctx->static_initializers, v->initializer.instrs);
|
||||
else
|
||||
list_move_tail(statements_list, v->initializer.instrs);
|
||||
vkd3d_free(v->initializer.args);
|
||||
vkd3d_free(v->initializer.instrs);
|
||||
}
|
||||
vkd3d_free(v);
|
||||
|
Loading…
x
Reference in New Issue
Block a user