winevulkan: Check if device extensions are supported.

Return VK_ERROR_EXTENSION_NOT_PRESENT for unsupported extensions.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-09-10 13:07:00 +02:00 committed by Alexandre Julliard
parent 931299bd33
commit 4907ffdf2a
1 changed files with 10 additions and 3 deletions

View File

@ -278,10 +278,16 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
dst->enabledLayerCount = 0;
dst->ppEnabledLayerNames = NULL;
TRACE("Enabled extensions: %u.\n", dst->enabledExtensionCount);
TRACE("Enabled %u extensions.\n", dst->enabledExtensionCount);
for (i = 0; i < dst->enabledExtensionCount; i++)
{
TRACE("Extension %u: %s.\n", i, debugstr_a(dst->ppEnabledExtensionNames[i]));
const char *extension_name = dst->ppEnabledExtensionNames[i];
TRACE("Extension %u: %s.\n", i, debugstr_a(extension_name));
if (!wine_vk_device_extension_supported(extension_name))
{
WARN("Extension %s is not supported.\n", debugstr_a(extension_name));
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
return VK_SUCCESS;
@ -632,6 +638,7 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev,
res = wine_vk_device_convert_create_info(create_info, &create_info_host);
if (res != VK_SUCCESS)
{
if (res != VK_ERROR_EXTENSION_NOT_PRESENT)
ERR("Failed to convert VkDeviceCreateInfo, res=%d.\n", res);
wine_vk_device_free(object);
return res;