mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
committed by
Alexandre Julliard
parent
80cac66b6f
commit
8096e4ae7b
@@ -1336,9 +1336,8 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in
|
||||
|
||||
/* Don't use the instruction itself as a source, as this makes structure
|
||||
* splitting easier. Instead copy it here. Since we retrieve sources from
|
||||
* the last instruction in the list, we do need to copy. Use a cast
|
||||
* instruction to the same type as a makeshift identity expression. */
|
||||
if (!(copy = hlsl_new_cast(rhs, rhs->data_type, &lhs->loc)))
|
||||
* the last instruction in the list, we do need to copy. */
|
||||
if (!(copy = hlsl_new_copy(rhs)))
|
||||
return NULL;
|
||||
list_add_tail(instrs, ©->node.entry);
|
||||
return ©->node;
|
||||
@@ -1365,8 +1364,7 @@ static bool add_increment(struct hlsl_ctx *ctx, struct list *instrs, bool decrem
|
||||
{
|
||||
struct hlsl_ir_expr *copy;
|
||||
|
||||
/* Use a cast to the same type as a makeshift identity expression. */
|
||||
if (!(copy = hlsl_new_cast(lhs, lhs->data_type, &lhs->loc)))
|
||||
if (!(copy = hlsl_new_copy(lhs)))
|
||||
return false;
|
||||
list_add_tail(instrs, ©->node.entry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user