vkd3d-shader/hlsl: Clean-up instruction block for offset node creation.

This commit is contained in:
Francisco Casas 2023-10-11 18:13:31 -03:00 committed by Alexandre Julliard
parent ab463f74bd
commit e93568f290
Notes: Alexandre Julliard 2023-10-31 22:38:12 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/396

View File

@ -29,8 +29,6 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str
struct hlsl_ir_node *idx_offset = NULL;
struct hlsl_ir_node *c;
hlsl_block_init(block);
switch (type->class)
{
case HLSL_CLASS_VECTOR:
@ -111,9 +109,14 @@ static struct hlsl_ir_node *new_offset_instr_from_deref(struct hlsl_ctx *ctx, st
{
struct hlsl_block idx_block;
hlsl_block_init(&idx_block);
if (!(offset = new_offset_from_path_index(ctx, &idx_block, type, offset, deref->path[i].node,
regset, loc)))
{
hlsl_block_cleanup(&idx_block);
return NULL;
}
hlsl_block_add_block(block, &idx_block);