Module: vkd3d Branch: master Commit: acc9d79fbb112642518f25d2b9046e7f5264d42a URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/acc9d79fbb112642518f25d2b9046e...
Author: Elizabeth Figura zfigura@codeweavers.com Date: Mon Jun 17 16:42:11 2024 -0500
vkd3d-shader/hlsl: Only allocate the aligned size for uniforms.
---
libs/vkd3d-shader/hlsl_codegen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 09066a61..36270b15 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -4188,8 +4188,10 @@ static struct hlsl_reg allocate_numeric_registers_for_type(struct hlsl_ctx *ctx, { unsigned int reg_size = type->reg_size[HLSL_REGSET_NUMERIC];
+ /* FIXME: We could potentially pack structs or arrays more efficiently... */ + if (type->class <= HLSL_CLASS_VECTOR) - return allocate_register(ctx, allocator, first_write, last_read, reg_size, type->dimx); + return allocate_register(ctx, allocator, first_write, last_read, type->dimx, type->dimx); else return allocate_range(ctx, allocator, first_write, last_read, reg_size); }