vkd3d: Do not automatically succeed if no extensions are available.

So error messages for missing required extensions are emitted.
This commit is contained in:
Giovanni Mascellani 2024-05-05 15:07:40 +02:00 committed by Alexandre Julliard
parent dbe3384609
commit 826b75722b
Notes: Alexandre Julliard 2024-05-08 22:52:26 +02:00
Approved-by: Conor McCarthy (@cmccarthy)
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/852

View File

@ -424,8 +424,6 @@ static HRESULT vkd3d_init_instance_caps(struct vkd3d_instance *instance,
ERR("Failed to enumerate instance extensions, vr %d.\n", vr); ERR("Failed to enumerate instance extensions, vr %d.\n", vr);
return hresult_from_vk_result(vr); return hresult_from_vk_result(vr);
} }
if (!count)
return S_OK;
if (!(vk_extensions = vkd3d_calloc(count, sizeof(*vk_extensions)))) if (!(vk_extensions = vkd3d_calloc(count, sizeof(*vk_extensions))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
@ -1534,8 +1532,6 @@ static HRESULT vkd3d_check_device_extensions(struct d3d12_device *device,
ERR("Failed to enumerate device extensions, vr %d.\n", vr); ERR("Failed to enumerate device extensions, vr %d.\n", vr);
return hresult_from_vk_result(vr); return hresult_from_vk_result(vr);
} }
if (!*vk_extension_count)
return S_OK;
if (!(*vk_extensions = vkd3d_calloc(*vk_extension_count, sizeof(**vk_extensions)))) if (!(*vk_extensions = vkd3d_calloc(*vk_extension_count, sizeof(**vk_extensions))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;