mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07: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:
committed by
Alexandre Julliard
parent
8930bb734f
commit
19b21ed005
@@ -1069,12 +1069,6 @@ static struct hlsl_ir_expr *add_expr(struct hlsl_ctx *ctx, struct list *instrs,
|
|||||||
return expr;
|
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,
|
static struct list *add_unary_expr(struct hlsl_ctx *ctx, struct list *instrs,
|
||||||
enum hlsl_ir_expr_op op, struct vkd3d_shader_location loc)
|
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);
|
hlsl_error(ctx, @3, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, "Invalid swizzle \"%s\".", $3);
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
$$ = append_unop($1, &swizzle->node);
|
list_add_tail($1, &swizzle->node.entry);
|
||||||
|
$$ = $1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3047,6 +3042,7 @@ unary_expr:
|
|||||||
{
|
{
|
||||||
struct hlsl_type *src_type = node_from_list($6)->data_type;
|
struct hlsl_type *src_type = node_from_list($6)->data_type;
|
||||||
struct hlsl_type *dst_type;
|
struct hlsl_type *dst_type;
|
||||||
|
struct hlsl_ir_expr *cast;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if ($2)
|
if ($2)
|
||||||
@@ -3074,7 +3070,13 @@ unary_expr:
|
|||||||
YYABORT;
|
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:
|
mul_expr:
|
||||||
|
Reference in New Issue
Block a user