d3dcompiler: Use new_cast() in 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
fbc9ff506c
commit
b89f027bc1
|
@ -1277,19 +1277,10 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type
|
||||||
static struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *type,
|
static struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *type,
|
||||||
struct source_location *loc)
|
struct source_location *loc)
|
||||||
{
|
{
|
||||||
struct hlsl_ir_expr *cast;
|
|
||||||
struct hlsl_ir_node *operands[3];
|
|
||||||
|
|
||||||
if (compare_hlsl_types(node->data_type, type))
|
if (compare_hlsl_types(node->data_type, type))
|
||||||
return node;
|
return node;
|
||||||
TRACE("Implicit conversion of expression to %s\n", debug_hlsl_type(type));
|
TRACE("Implicit conversion of expression to %s\n", debug_hlsl_type(type));
|
||||||
operands[0] = node;
|
return &new_cast(node, type, loc)->node;
|
||||||
operands[1] = operands[2] = NULL;
|
|
||||||
cast = new_expr(HLSL_IR_UNOP_CAST, operands, loc);
|
|
||||||
if (!cast)
|
|
||||||
return NULL;
|
|
||||||
cast->node.data_type = type;
|
|
||||||
return &cast->node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands,
|
struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands,
|
||||||
|
|
Loading…
Reference in New Issue