vkd3d: Check for mutable descriptor set allocation failure in d3d12_descriptor_heap_create_descriptor_set().

This commit is contained in:
Conor McCarthy 2024-05-23 12:13:59 +10:00 committed by Alexandre Julliard
parent f090d1e80d
commit ae25c80498
Notes: Alexandre Julliard 2024-05-27 23:14:17 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/882

View File

@ -4284,12 +4284,14 @@ static HRESULT d3d12_descriptor_heap_create_descriptor_set(struct d3d12_descript
VkDescriptorSetVariableDescriptorCountAllocateInfoEXT set_size; VkDescriptorSetVariableDescriptorCountAllocateInfoEXT set_size;
VkDescriptorSetAllocateInfo set_desc; VkDescriptorSetAllocateInfo set_desc;
VkResult vr; VkResult vr;
HRESULT hr;
if (!device->vk_descriptor_heap_layouts[set].vk_set_layout) if (!device->vk_descriptor_heap_layouts[set].vk_set_layout)
{ {
/* Set 0 uses mutable descriptors, and this set is unused. */ /* Set 0 uses mutable descriptors, and this set is unused. */
if (!descriptor_heap->vk_descriptor_sets[0].vk_set) if (!descriptor_heap->vk_descriptor_sets[0].vk_set
d3d12_descriptor_heap_create_descriptor_set(descriptor_heap, device, 0); && 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_set = descriptor_heap->vk_descriptor_sets[0].vk_set;
descriptor_set->vk_type = device->vk_descriptor_heap_layouts[set].type; descriptor_set->vk_type = device->vk_descriptor_heap_layouts[set].type;
return S_OK; return S_OK;