mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Factor out hlsl_new_jump().
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: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
774609e1e2
commit
ccd67dcf37
@@ -377,10 +377,8 @@ static bool append_conditional_break(struct list *cond_list)
|
||||
return false;
|
||||
list_add_tail(cond_list, &iff->node.entry);
|
||||
|
||||
if (!(jump = vkd3d_malloc(sizeof(*jump))))
|
||||
if (!(jump = hlsl_new_jump(HLSL_IR_JUMP_BREAK, condition->loc)))
|
||||
return false;
|
||||
init_node(&jump->node, HLSL_IR_JUMP, NULL, condition->loc);
|
||||
jump->type = HLSL_IR_JUMP_BREAK;
|
||||
list_add_head(&iff->then_instrs, &jump->node.entry);
|
||||
return true;
|
||||
}
|
||||
@@ -563,10 +561,8 @@ static struct hlsl_ir_jump *add_return(struct hlsl_ctx *ctx, struct list *instrs
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(jump = vkd3d_malloc(sizeof(*jump))))
|
||||
if (!(jump = hlsl_new_jump(HLSL_IR_JUMP_RETURN, loc)))
|
||||
return NULL;
|
||||
init_node(&jump->node, HLSL_IR_JUMP, NULL, loc);
|
||||
jump->type = HLSL_IR_JUMP_RETURN;
|
||||
list_add_tail(instrs, &jump->node.entry);
|
||||
|
||||
return jump;
|
||||
|
||||
Reference in New Issue
Block a user