From 4907ffdf2a15ab3a1e3749def37f4be67b758a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 10 Sep 2018 13:07:00 +0200 Subject: [PATCH] winevulkan: Check if device extensions are supported. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return VK_ERROR_EXTENSION_NOT_PRESENT for unsupported extensions. Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/winevulkan/vulkan.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 7485fdc0466..83041a54308 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -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,7 +638,8 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev, res = wine_vk_device_convert_create_info(create_info, &create_info_host); if (res != VK_SUCCESS) { - ERR("Failed to convert VkDeviceCreateInfo, res=%d.\n", res); + if (res != VK_ERROR_EXTENSION_NOT_PRESENT) + ERR("Failed to convert VkDeviceCreateInfo, res=%d.\n", res); wine_vk_device_free(object); return res; }