vkd3d-shader/hlsl: Introduce an hlsl_block_add_block() helper.

This commit is contained in:
Zebediah Figura 2023-02-16 18:00:01 -06:00 committed by Alexandre Julliard
parent ceac81b816
commit 1da5a9a490
Notes: Alexandre Julliard 2023-04-06 22:22:24 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/138
3 changed files with 8 additions and 3 deletions

View File

@ -1023,7 +1023,7 @@ struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl
vkd3d_free(store);
return NULL;
}
list_move_tail(&block->instrs, &comp_path_block.instrs);
hlsl_block_add_block(block, &comp_path_block);
hlsl_src_from_node(&store->rhs, rhs);
if (type_is_single_reg(rhs->data_type))
@ -1215,7 +1215,7 @@ struct hlsl_ir_load *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_b
vkd3d_free(load);
return NULL;
}
list_move_tail(&block->instrs, &comp_path_block.instrs);
hlsl_block_add_block(block, &comp_path_block);
hlsl_block_add_instr(block, &load->node);

View File

@ -862,6 +862,11 @@ static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir
list_add_tail(&block->instrs, &instr->entry);
}
static inline void hlsl_block_add_block(struct hlsl_block *block, struct hlsl_block *add)
{
list_move_tail(&block->instrs, &add->instrs);
}
static inline void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node)
{
src->node = node;

View File

@ -114,7 +114,7 @@ static struct hlsl_ir_node *new_offset_instr_from_deref(struct hlsl_ctx *ctx, st
deref->offset_regset, loc)))
return NULL;
list_move_tail(&block->instrs, &idx_block.instrs);
hlsl_block_add_block(block, &idx_block);
type = hlsl_get_element_type_from_path_index(ctx, type, deref->path[i].node);
}