vkd3d-shader/hlsl: Correctly calculate offsets for array elements.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2022-03-17 21:58:35 +01:00
committed by Alexandre Julliard
parent 2b0fd2a055
commit ee764359d0
6 changed files with 30 additions and 3 deletions

View File

@@ -607,7 +607,7 @@ static struct hlsl_ir_load *add_array_load(struct hlsl_ctx *ctx, struct list *in
return NULL;
}
if (!(c = hlsl_new_uint_constant(ctx, data_type->reg_size, loc)))
if (!(c = hlsl_new_uint_constant(ctx, hlsl_type_get_array_element_reg_size(data_type), loc)))
return NULL;
list_add_tail(instrs, &c->node.entry);
if (!(mul = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, index, &c->node)))