vkd3d: Only allocate descriptor offsets when descriptor arrays are used.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2021-11-24 00:41:34 +10:00 committed by Alexandre Julliard
parent 535d4a78b1
commit d6ff603605

View File

@ -1170,8 +1170,8 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
if (!(root_signature->descriptor_mapping = vkd3d_calloc(root_signature->binding_count, if (!(root_signature->descriptor_mapping = vkd3d_calloc(root_signature->binding_count,
sizeof(*root_signature->descriptor_mapping)))) sizeof(*root_signature->descriptor_mapping))))
goto fail; goto fail;
if (!(root_signature->descriptor_offsets = vkd3d_calloc(root_signature->binding_count, if (root_signature->use_descriptor_arrays && !(root_signature->descriptor_offsets = vkd3d_calloc(
sizeof(*root_signature->descriptor_offsets)))) root_signature->binding_count, sizeof(*root_signature->descriptor_offsets))))
goto fail; goto fail;
root_signature->root_constant_count = info.root_constant_count; root_signature->root_constant_count = info.root_constant_count;
if (!(root_signature->root_constants = vkd3d_calloc(root_signature->root_constant_count, if (!(root_signature->root_constants = vkd3d_calloc(root_signature->root_constant_count,