From 5faa4540a1dda99d67ade15ee2b66186c48ff627 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 25 Feb 2016 13:56:57 -0700 Subject: layers: GL107, Validate queueFamilyIndices for CreateSwapchain --- layers/swapchain.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index e4a00c34..282a271a 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -1559,6 +1559,21 @@ static VkBool32 validateCreateSwapchainKHR( // Keep around a useful pointer to pPhysicalDevice: SwpPhysicalDevice *pPhysicalDevice = pDevice->pPhysicalDevice; + // Validate pCreateInfo values with result of + // vkGetPhysicalDeviceQueueFamilyProperties + if (pPhysicalDevice && pPhysicalDevice->gotQueueFamilyPropertyCount) { + for (auto i = 0; i < pCreateInfo->queueFamilyIndexCount; i++) { + if (pCreateInfo->pQueueFamilyIndices[i] >= + pPhysicalDevice->numOfQueueFamilies) { + skipCall |= LOG_ERROR_QUEUE_FAMILY_INDEX_TOO_LARGE( + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + pPhysicalDevice, "VkPhysicalDevice", + pCreateInfo->pQueueFamilyIndices[i], + pPhysicalDevice->numOfQueueFamilies); + } + } + } + // Validate pCreateInfo values with the results of // vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): if (!pPhysicalDevice || !pPhysicalDevice->gotSurfaceCapabilities) { -- cgit v1.2.3