anv: Add a per-device table of enabled extensions
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Jan 2018 00:22:45 +0000 (16:22 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 23 Jan 2018 08:15:40 +0000 (00:15 -0800)
Nothing uses this at the moment, but we will need it soon.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h

index 2abf73dd95ed457f6251b91359d34161844d5a36..33b2a52a51ce5f9885b060f74f1beb5f4cda92b6 100644 (file)
@@ -1241,6 +1241,7 @@ VkResult anv_CreateDevice(
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
 
+   struct anv_device_extension_table enabled_extensions;
    for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
       int idx;
       for (idx = 0; idx < ANV_DEVICE_EXTENSION_COUNT; idx++) {
@@ -1254,6 +1255,8 @@ VkResult anv_CreateDevice(
 
       if (!physical_device->supported_extensions.extensions[idx])
          return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT);
+
+      enabled_extensions.extensions[idx] = true;
    }
 
    /* Check enabled features */
@@ -1310,6 +1313,7 @@ VkResult anv_CreateDevice(
 
    device->robust_buffer_access = pCreateInfo->pEnabledFeatures &&
       pCreateInfo->pEnabledFeatures->robustBufferAccess;
+   device->enabled_extensions = enabled_extensions;
 
    if (pthread_mutex_init(&device->mutex, NULL) != 0) {
       result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
index a1f34aa22db5d724c482ce07b86391275bff3a8c..36d87e2f17681eaee7233b51ea636228582706e9 100644 (file)
@@ -857,6 +857,7 @@ struct anv_device {
     int                                         fd;
     bool                                        can_chain_batches;
     bool                                        robust_buffer_access;
+    struct anv_device_extension_table           enabled_extensions;
 
     struct anv_bo_pool                          batch_bo_pool;