mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
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:
parent
e8e138ed54
commit
06551db10a
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user