mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-compiler: Do not overallocate memory for shader code.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
98689bf33c
commit
f7a21ad982
@ -2509,7 +2509,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_constant(struct vkd3d_dxbc_compile
|
||||
const struct vkd3d_shader_register *reg, DWORD swizzle, DWORD write_mask)
|
||||
{
|
||||
unsigned int component_count = vkd3d_write_mask_component_count(write_mask);
|
||||
uint32_t values[VKD3D_VEC4_SIZE];
|
||||
uint32_t values[VKD3D_VEC4_SIZE] = {0};
|
||||
unsigned int i, j;
|
||||
|
||||
assert(reg->type == VKD3DSPR_IMMCONST);
|
||||
|
@ -46,7 +46,7 @@ static bool read_shader(struct vkd3d_shader_code *shader, const char *filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(code = malloc(sizeof(uint32_t) * shader->size)))
|
||||
if (!(code = malloc(shader->size)))
|
||||
{
|
||||
fprintf(stderr, "Out of memory.\n");
|
||||
fclose(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user