From 920bd2c0bc605be288d3dd39ab7e900a8ad9e5ad Mon Sep 17 00:00:00 2001
From: Jason Ekstrand <jason.ekstrand@intel.com>
Date: Tue, 16 Jan 2018 16:13:48 -0800
Subject: anv: Add a per-instance table of enabled extensions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Nothing needs this yet but we will want it later.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
---
 src/intel/vulkan/anv_device.c  | 4 ++++
 src/intel/vulkan/anv_private.h | 2 ++
 2 files changed, 6 insertions(+)

(limited to 'src/intel')

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 7835b8780b9..9fd324ba351 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -539,6 +539,7 @@ VkResult anv_CreateInstance(
                        VK_VERSION_PATCH(client_version));
    }
 
+   struct anv_instance_extension_table enabled_extensions = {};
    for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
       int idx;
       for (idx = 0; idx < ANV_INSTANCE_EXTENSION_COUNT; idx++) {
@@ -552,6 +553,8 @@ VkResult anv_CreateInstance(
 
       if (!anv_instance_extensions_supported.extensions[idx])
          return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT);
+
+      enabled_extensions.extensions[idx] = true;
    }
 
    instance = vk_alloc2(&default_alloc, pAllocator, sizeof(*instance), 8,
@@ -567,6 +570,7 @@ VkResult anv_CreateInstance(
       instance->alloc = default_alloc;
 
    instance->apiVersion = client_version;
+   instance->enabled_extensions = enabled_extensions;
    instance->physicalDeviceCount = -1;
 
    result = vk_debug_report_instance_init(&instance->debug_report_callbacks);
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 55417faceaa..e4ffdf2845b 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -794,6 +794,8 @@ struct anv_instance {
     VkAllocationCallbacks                       alloc;
 
     uint32_t                                    apiVersion;
+    struct anv_instance_extension_table         enabled_extensions;
+
     int                                         physicalDeviceCount;
     struct anv_physical_device                  physicalDevice;
 
-- 
cgit v1.2.3