summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2018-02-06 10:37:16 +0100
committerJason Ekstrand <[email protected]>2018-03-07 12:13:47 -0800
commit605fd7c0daa34e76f0b9d10ee77d2c06ac9fe06d (patch)
tree8976ac15e97b95e70b36deefd02e283904a5b83b /src/intel
parentb262f17b159141fb21c60971d21b884dcd226152 (diff)
anv/device: fail to initialize device if we have queues with unsupported flags
This is not strictly necessary since users should not be requesting any flags that are not valid for the list of enabled features requested and we already fail if they attempt to use an unsupported feature, however it is an easy to implement sanity check that would help developes realize that they are doing things wrong, so we might as well do it. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_device.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index bccb669e4f2..a4237d6b2e5 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1467,6 +1467,15 @@ VkResult anv_CreateDevice(
}
}
+ /* Check requested queues and fail if we are requested to create any
+ * queues with flags we don't support.
+ */
+ assert(pCreateInfo->queueCreateInfoCount > 0);
+ for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) {
+ if (pCreateInfo->pQueueCreateInfos[i].flags != 0)
+ return vk_error(VK_ERROR_INITIALIZATION_FAILED);
+ }
+
/* Check if client specified queue priority. */
const VkDeviceQueueGlobalPriorityCreateInfoEXT *queue_priority =
vk_find_struct_const(pCreateInfo->pQueueCreateInfos[0].pNext,