diff options
author | Erik Faye-Lund <[email protected]> | 2018-10-24 09:46:05 +0200 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-10-28 08:51:43 +0000 |
commit | 48f1f20a9dc6bbb888f6c2b37f519e400232fbc9 (patch) | |
tree | 53dbf27f0bcba51ec681b995fb3266a6702f7bd7 /src | |
parent | 8d46e35d16e3936968958bcab86d61967a673305 (diff) |
zink: detect presence of VK_KHR_maintenance1
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/zink/zink_screen.c | 18 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_screen.h | 2 |
2 files changed, 20 insertions, 0 deletions
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; |