mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Get rid of append_unop().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8930bb734f
commit
19b21ed005
@ -1069,12 +1069,6 @@ static struct hlsl_ir_expr *add_expr(struct hlsl_ctx *ctx, struct list *instrs,
|
||||
return expr;
|
||||
}
|
||||
|
||||
static struct list *append_unop(struct list *list, struct hlsl_ir_node *node)
|
||||
{
|
||||
list_add_tail(list, &node->entry);
|
||||
return list;
|
||||
}
|
||||
|
||||
static struct list *add_unary_expr(struct hlsl_ctx *ctx, struct list *instrs,
|
||||
enum hlsl_ir_expr_op op, struct vkd3d_shader_location loc)
|
||||
{
|
||||
@ -2934,7 +2928,8 @@ postfix_expr:
|
||||
hlsl_error(ctx, @3, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Invalid swizzle \"%s\".", $3);
|
||||
YYABORT;
|
||||
}
|
||||
$$ = append_unop($1, &swizzle->node);
|
||||
list_add_tail($1, &swizzle->node.entry);
|
||||
$$ = $1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3047,6 +3042,7 @@ unary_expr:
|
||||
{
|
||||
struct hlsl_type *src_type = node_from_list($6)->data_type;
|
||||
struct hlsl_type *dst_type;
|
||||
struct hlsl_ir_expr *cast;
|
||||
unsigned int i;
|
||||
|
||||
if ($2)
|
||||
@ -3074,7 +3070,13 @@ unary_expr:
|
||||
YYABORT;
|
||||
}
|
||||
|
||||
$$ = append_unop($6, &hlsl_new_cast(ctx, node_from_list($6), dst_type, &@3)->node);
|
||||
if (!(cast = hlsl_new_cast(ctx, node_from_list($6), dst_type, &@3)))
|
||||
{
|
||||
hlsl_free_instr_list($6);
|
||||
YYABORT;
|
||||
}
|
||||
list_add_tail($6, &cast->node.entry);
|
||||
$$ = $6;
|
||||
}
|
||||
|
||||
mul_expr:
|
||||
|
Loading…
x
Reference in New Issue
Block a user