[Mesa-dev] [PATCH 08/21] anv: Add a per-device table of enabled extensions
Jason Ekstrand
jason at jlekstrand.net
Sat Jan 20 19:11:43 UTC 2018
Nothing uses this at the moment, but we will need it soon.
---
src/intel/vulkan/anv_device.c | 4 ++++
src/intel/vulkan/anv_private.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 3c8eb52..23e6fe5 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1211,6 +1211,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++) {
@@ -1224,6 +1225,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 */
@@ -1280,6 +1283,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);
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index b68ef77..550fec4 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -877,6 +877,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;
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list