aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-10-03 18:06:20 +1300
committerChris Forbes <chrisforbes@google.com>2016-10-04 08:37:27 +1300
commit351fdc1a6a3ce4bf388436b5828e6cb14b7c5bfb (patch)
treeede859105f3ca98aff8a79af70305d7b8688a350 /layers/core_validation.cpp
parentf893d30416022e456327b67630a755c503e89271 (diff)
downloadusermoji-351fdc1a6a3ce4bf388436b5828e6cb14b7c5bfb.tar.xz
layers: Move queue_family_properties into PHYSICAL_DEVICE_STATE
This isn't instance-wide. Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index acba5949..ea108dcb 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -109,8 +109,6 @@ struct layer_data {
devExts device_extensions = {};
unordered_set<VkQueue> queues; // All queues under given device
- // Vector indices correspond to queueFamilyIndex
- vector<unique_ptr<VkQueueFamilyProperties>> queue_family_properties;
// Global set of all cmdBuffers that are inFlight on this device
unordered_set<VkCommandBuffer> 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,