From: Chris Forbes Date: Mon, 3 Oct 2016 05:06:20 +0000 (+1300) Subject: layers: Move queue_family_properties into PHYSICAL_DEVICE_STATE X-Git-Tag: upstream/1.1.92~2439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=351fdc1a6a3ce4bf388436b5828e6cb14b7c5bfb;p=platform%2Fupstream%2FVulkan-Tools.git layers: Move queue_family_properties into PHYSICAL_DEVICE_STATE This isn't instance-wide. Signed-off-by: Chris Forbes --- diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index acba594..ea108dc 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -109,8 +109,6 @@ struct layer_data { devExts device_extensions = {}; unordered_set queues; // All queues under given device - // Vector indices correspond to queueFamilyIndex - vector> queue_family_properties; // Global set of all cmdBuffers that are inFlight on this device unordered_set globalInFlightCmdBuffers; // Layer specific data @@ -4381,20 +4379,19 @@ bool ValidateRequestedQueueFamilyProperties(layer_data *instance_data, VkPhysica // Check that the requested queue properties are valid for (uint32_t i = 0; i < create_info->queueCreateInfoCount; i++) { uint32_t requestedIndex = create_info->pQueueCreateInfos[i].queueFamilyIndex; - if (instance_data->queue_family_properties.size() <= - requestedIndex) { // requested index is out of bounds for this physical device + if (requestedIndex >= physical_device_state->queue_family_properties.size()) { skip_call |= log_msg( instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL", "Invalid queue create request in vkCreateDevice(). Invalid queueFamilyIndex %u requested.", requestedIndex); } else if (create_info->pQueueCreateInfos[i].queueCount > - instance_data->queue_family_properties[requestedIndex]->queueCount) { + physical_device_state->queue_family_properties[requestedIndex].queueCount) { skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL", "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but " "requested queueCount is %u.", - requestedIndex, instance_data->queue_family_properties[requestedIndex]->queueCount, + requestedIndex, physical_device_state->queue_family_properties[requestedIndex].queueCount, create_info->pQueueCreateInfos[i].queueCount); } } @@ -11459,12 +11456,12 @@ GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t physical_device_state->queueFamilyPropertiesCount = *pCount; } else { // Save queue family properties - instance_data->queue_family_properties.reserve(*pCount); + if (physical_device_state->queue_family_properties.size() < *pCount) + physical_device_state->queue_family_properties.resize(*pCount); for (uint32_t i = 0; i < *pCount; i++) { - instance_data->queue_family_properties.emplace_back(new VkQueueFamilyProperties(pQueueFamilyProperties[i])); + physical_device_state->queue_family_properties[i] = pQueueFamilyProperties[i]; } } - return; } else { log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, diff --git a/layers/core_validation.h b/layers/core_validation.h index f1564dd..182844a 100644 --- a/layers/core_validation.h +++ b/layers/core_validation.h @@ -213,4 +213,5 @@ struct PHYSICAL_DEVICE_STATE { CALL_STATE vkGetPhysicalDeviceFeaturesState = UNCALLED; VkPhysicalDeviceFeatures features = {}; VkPhysicalDevice phys_device = VK_NULL_HANDLE; + std::vector queue_family_properties; };