vkd3d-shader: Zero-initialize constant definitions.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2021-06-21 23:37:06 -05:00 committed by Alexandre Julliard
parent e8e138ed54
commit 06551db10a

View File

@ -843,7 +843,12 @@ static void allocate_const_registers_recurse(struct hlsl_ctx *ctx, struct list *
if (!hlsl_array_reserve(ctx, (void **)&defs->values, &defs->size,
constant->reg.id + reg_size, sizeof(*defs->values)))
return;
defs->count = max(defs->count, constant->reg.id + reg_size);
if (constant->reg.id + reg_size > defs->count)
{
memset(&defs->values[defs->count], 0,
sizeof(*defs->values) * (constant->reg.id + reg_size - defs->count));
defs->count = constant->reg.id + reg_size;
}
assert(type->type <= HLSL_CLASS_LAST_NUMERIC);