vkd3d-shader/hlsl: Use unique temps for per-component operations.

This commit is contained in:
Elizabeth Figura
2025-02-19 19:46:46 -06:00
committed by Henri Verbeet
parent 25ae2fcc84
commit 02d70be6ef
Notes: Henri Verbeet 2025-09-02 11:45:55 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1592

View File

@@ -6342,8 +6342,15 @@ static void allocate_instr_temp_register(struct hlsl_ctx *ctx,
ctx->temp_count = max(ctx->temp_count, instr->reg.id + 1); ctx->temp_count = max(ctx->temp_count, instr->reg.id + 1);
} }
else if (is_per_component) else if (is_per_component)
instr->reg = allocate_numeric_registers_for_type(ctx, allocator, {
instr->index, instr->last_read, instr->data_type); instr->reg.writemask = vkd3d_write_mask_from_component_count(instr->data_type->e.numeric.dimx);
instr->reg.allocation_size = 1;
instr->reg.allocated = true;
instr->reg.type = VKD3DSPR_TEMP;
instr->reg.id = ctx->temp_count++;
record_allocation(ctx, allocator, ctx->temp_count - 1, VKD3DSP_WRITEMASK_ALL, 1, UINT_MAX, 0, false);
}
else else
{ {
instr->reg.writemask = vkd3d_write_mask_from_component_count(instr->data_type->e.numeric.dimx); instr->reg.writemask = vkd3d_write_mask_from_component_count(instr->data_type->e.numeric.dimx);