From ae25c804984704264810dbd707ec3a9f373b27e5 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 23 May 2024 12:13:59 +1000 Subject: [PATCH] vkd3d: Check for mutable descriptor set allocation failure in d3d12_descriptor_heap_create_descriptor_set(). --- libs/vkd3d/resource.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 7a2f464c..c897d9f2 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -4284,12 +4284,14 @@ static HRESULT d3d12_descriptor_heap_create_descriptor_set(struct d3d12_descript VkDescriptorSetVariableDescriptorCountAllocateInfoEXT set_size; VkDescriptorSetAllocateInfo set_desc; VkResult vr; + HRESULT hr; if (!device->vk_descriptor_heap_layouts[set].vk_set_layout) { /* Set 0 uses mutable descriptors, and this set is unused. */ - if (!descriptor_heap->vk_descriptor_sets[0].vk_set) - d3d12_descriptor_heap_create_descriptor_set(descriptor_heap, device, 0); + if (!descriptor_heap->vk_descriptor_sets[0].vk_set + && FAILED(hr = d3d12_descriptor_heap_create_descriptor_set(descriptor_heap, device, 0))) + return hr; descriptor_set->vk_set = descriptor_heap->vk_descriptor_sets[0].vk_set; descriptor_set->vk_type = device->vk_descriptor_heap_layouts[set].type; return S_OK;