From d6ff603605d33dfbb28a62348670f0d0c9d06f74 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 24 Nov 2021 00:41:34 +1000 Subject: [PATCH] vkd3d: Only allocate descriptor offsets when descriptor arrays are used. Signed-off-by: Conor McCarthy Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 413b0a30..cb3f99ad 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -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, sizeof(*root_signature->descriptor_mapping)))) goto fail; - if (!(root_signature->descriptor_offsets = vkd3d_calloc(root_signature->binding_count, - sizeof(*root_signature->descriptor_offsets)))) + if (root_signature->use_descriptor_arrays && !(root_signature->descriptor_offsets = vkd3d_calloc( + root_signature->binding_count, sizeof(*root_signature->descriptor_offsets)))) goto fail; root_signature->root_constant_count = info.root_constant_count; if (!(root_signature->root_constants = vkd3d_calloc(root_signature->root_constant_count,