vkd3d-shader/fx: Fix state block entry array shifting when decomposing.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-08-05 19:27:32 +02:00 committed by Henri Verbeet
parent 7c3677b114
commit 1559237780
Notes: Henri Verbeet 2024-08-06 16:59:31 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/985

View File

@ -1824,7 +1824,7 @@ static unsigned int decompose_fx_4_state_block(struct hlsl_ir_var *var, struct h
if (entry_index != block->count - 1)
{
memmove(&block->entries[entry_index + entry->args_count], &block->entries[entry_index + 1],
(entry->args_count - 1) * sizeof(*block->entries));
(block->count - entry_index - 1) * sizeof(*block->entries));
}
block->count += entry->args_count - 1;
@ -1839,7 +1839,7 @@ static unsigned int decompose_fx_4_state_block(struct hlsl_ir_var *var, struct h
}
hlsl_free_state_block_entry(entry);
return entry->args_count - 1;
return entry->args_count;
}
static void write_fx_4_state_block(struct hlsl_ir_var *var, unsigned int block_index,