From: Erik Faye-Lund Date: Wed, 24 Oct 2018 07:46:05 +0000 (+0200) Subject: zink: detect presence of VK_KHR_maintenance1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48f1f20a9dc6bbb888f6c2b37f519e400232fbc9;p=mesa.git zink: detect presence of VK_KHR_maintenance1 Acked-by: Jordan Justen --- diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 68b593c8d37..66cc6ef4490 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -705,6 +705,24 @@ zink_create_screen(struct sw_winsys *winsys) vkGetPhysicalDeviceFeatures(screen->pdev, &screen->feats); vkGetPhysicalDeviceMemoryProperties(screen->pdev, &screen->mem_props); + uint32_t num_extensions = 0; + if (vkEnumerateDeviceExtensionProperties(screen->pdev, NULL, + &num_extensions, NULL) == VK_SUCCESS && num_extensions > 0) { + VkExtensionProperties *extensions = MALLOC(sizeof(VkExtensionProperties) * + num_extensions); + if (extensions) { + vkEnumerateDeviceExtensionProperties(screen->pdev, NULL, + &num_extensions, extensions); + + for (uint32_t i = 0; i < num_extensions; ++i) { + if (!strcmp(extensions[i].extensionName, + VK_KHR_MAINTENANCE1_EXTENSION_NAME)) + screen->have_VK_KHR_maintenance1 = true; + } + FREE(extensions); + } + } + VkDeviceQueueCreateInfo qci = {}; float dummy = 0.0f; qci.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index c79ddc18e4b..ab20a683f88 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -44,9 +44,11 @@ struct zink_screen { VkInstance instance; VkPhysicalDevice pdev; + VkPhysicalDeviceProperties props; VkPhysicalDeviceFeatures feats; VkPhysicalDeviceMemoryProperties mem_props; + bool have_VK_KHR_maintenance1; uint32_t gfx_queue; VkDevice dev;