vk/runtime: keep track of supported instance extensions
authorEric Engestrom <eric@igalia.com>
Fri, 10 Feb 2023 17:56:36 +0000 (17:56 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Feb 2023 23:28:29 +0000 (23:28 +0000)
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>

src/amd/vulkan/radv_device.c
src/vulkan/runtime/vk_instance.c
src/vulkan/runtime/vk_instance.h

index 1a8eb31..c6740d3 100644 (file)
@@ -1253,9 +1253,8 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
    struct vk_instance_dispatch_table dispatch_table;
    vk_instance_dispatch_table_from_entrypoints(&dispatch_table, &radv_instance_entrypoints, true);
    vk_instance_dispatch_table_from_entrypoints(&dispatch_table, &wsi_instance_entrypoints, false);
-   struct vk_instance_extension_table extensions_supported = radv_instance_extensions_supported;
 
-   result = vk_instance_init(&instance->vk, &extensions_supported, &dispatch_table,
+   result = vk_instance_init(&instance->vk, &radv_instance_extensions_supported, &dispatch_table,
                              pCreateInfo, pAllocator);
    if (result != VK_SUCCESS) {
       vk_free(pAllocator, instance);
index 21a0067..a17a62e 100644 (file)
@@ -135,6 +135,8 @@ vk_instance_init(struct vk_instance *instance,
        !VERSION_IS_1_0(instance->app_info.api_version))
       return VK_ERROR_INCOMPATIBLE_DRIVER;
 
+   instance->supported_extensions = supported_extensions;
+
    for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
       int idx;
       for (idx = 0; idx < VK_INSTANCE_EXTENSION_COUNT; idx++) {
index a1f0535..b1ddf6a 100644 (file)
@@ -78,6 +78,13 @@ struct vk_instance {
    /** VkInstanceCreateInfo::pApplicationInfo */
    struct vk_app_info app_info;
 
+   /** Table of all supported instance extensions
+    *
+    * This is the static const struct passed by the driver as the
+    * `supported_extensions` parameter to `vk_instance_init()`.
+    */
+   const struct vk_instance_extension_table *supported_extensions;
+
    /** Table of all enabled instance extensions
     *
     * This is generated automatically as part of `vk_instance_init()` from