d3dcompiler: Pass the instruction list to implicit_conversion().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9b3e6b1971
commit
251c8546b5
|
@ -1059,6 +1059,8 @@ static inline void init_node(struct hlsl_ir_node *node, enum hlsl_ir_node_type t
|
|||
|
||||
struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lhs,
|
||||
enum parse_assign_op assign_op, struct hlsl_ir_node *rhs) DECLSPEC_HIDDEN;
|
||||
struct hlsl_ir_node *add_implicit_conversion(struct list *instrs, struct hlsl_ir_node *node, struct hlsl_type *type,
|
||||
struct source_location *loc) DECLSPEC_HIDDEN;
|
||||
|
||||
BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN;
|
||||
struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN;
|
||||
|
@ -1077,8 +1079,6 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope
|
|||
struct source_location *loc) DECLSPEC_HIDDEN;
|
||||
struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type,
|
||||
struct source_location *loc) DECLSPEC_HIDDEN;
|
||||
struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *type,
|
||||
struct source_location *loc) DECLSPEC_HIDDEN;
|
||||
void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN;
|
||||
BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN;
|
||||
void init_functions_tree(struct wine_rb_tree *funcs) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -572,7 +572,7 @@ static struct hlsl_ir_jump *add_return(struct list *instrs,
|
|||
{
|
||||
struct hlsl_ir_assignment *assignment;
|
||||
|
||||
if (!(return_value = implicit_conversion(return_value, return_type, &loc)))
|
||||
if (!(return_value = add_implicit_conversion(instrs, return_value, return_type, &loc)))
|
||||
return NULL;
|
||||
|
||||
if (!(assignment = make_simple_assignment(hlsl_ctx.cur_function->return_var, return_value)))
|
||||
|
@ -2474,7 +2474,7 @@ postfix_expr: primary_expr
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!(arg = implicit_conversion(arg,
|
||||
if (!(arg = add_implicit_conversion($4.instrs, arg,
|
||||
hlsl_ctx.builtin_types.vector[$2->base_type][width - 1], &arg->loc)))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -1301,8 +1301,8 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type
|
|||
return new_hlsl_type(NULL, type, base, dimx, dimy);
|
||||
}
|
||||
|
||||
struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *dst_type,
|
||||
struct source_location *loc)
|
||||
struct hlsl_ir_node *add_implicit_conversion(struct list *instrs, struct hlsl_ir_node *node,
|
||||
struct hlsl_type *dst_type, struct source_location *loc)
|
||||
{
|
||||
struct hlsl_type *src_type = node->data_type;
|
||||
struct hlsl_ir_expr *cast;
|
||||
|
@ -1324,7 +1324,7 @@ struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_
|
|||
|
||||
if (!(cast = new_cast(node, dst_type, loc)))
|
||||
return NULL;
|
||||
list_add_after(&node->entry, &cast->node.entry);
|
||||
list_add_tail(instrs, &cast->node.entry);
|
||||
return &cast->node;
|
||||
}
|
||||
|
||||
|
@ -1455,7 +1455,7 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh
|
|||
{
|
||||
writemask = (1 << lhs_type->dimx) - 1;
|
||||
|
||||
if (!(rhs = implicit_conversion(rhs, lhs_type, &rhs->loc)))
|
||||
if (!(rhs = add_implicit_conversion(instrs, rhs, lhs_type, &rhs->loc)))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue