vkd3d-shader: Factor out hlsl_new_copy().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-03-16 16:31:52 -05:00
committed by Alexandre Julliard
parent 80cac66b6f
commit 8096e4ae7b
3 changed files with 10 additions and 5 deletions

View File

@@ -382,6 +382,12 @@ struct hlsl_ir_expr *hlsl_new_cast(struct hlsl_ir_node *node, struct hlsl_type *
return hlsl_ir_expr(cast);
}
struct hlsl_ir_expr *hlsl_new_copy(struct hlsl_ir_node *node)
{
/* Use a cast to the same type as a makeshift identity expression. */
return hlsl_new_cast(node, node->data_type, &node->loc);
}
struct hlsl_ir_var *hlsl_new_var(const char *name, struct hlsl_type *type, const struct vkd3d_shader_location loc,
const char *semantic, unsigned int modifiers, const struct hlsl_reg_reservation *reg_reservation)
{