Browse Source

anv: Add a per-device table of enabled extensions

Nothing uses this at the moment, but we will need it soon.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
tags/18.0-branchpoint
Jason Ekstrand 7 years ago
parent
commit
abc62282b5
2 changed files with 5 additions and 0 deletions
  1. 4
    0
      src/intel/vulkan/anv_device.c
  2. 1
    0
      src/intel/vulkan/anv_private.h

+ 4
- 0
src/intel/vulkan/anv_device.c View 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);

+ 1
- 0
src/intel/vulkan/anv_private.h View 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;


Loading…
Cancel
Save