From 4ceffcba0a3e5054ee94b7f76add5bfee5b13357 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 18 Jul 2016 13:14:01 -0600 Subject: layers: Remove DRAWSTATE_INVALID_POOL check This check was only flagged when Allocating descriptor sets or resetting a descriptor pool, and in both cases object_tracker will be the first layer to identify and flag the error. Removing this as a redundant check and updating documentation. --- layers/descriptor_sets.cpp | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'layers/descriptor_sets.cpp') diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 10463ab0..fa67b2cb 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -1304,34 +1304,26 @@ bool cvdescriptorset::ValidateAllocateDescriptorSets(const debug_report_data *re } } auto pool_node = getPoolNode(dev_data, p_alloc_info->descriptorPool); - if (!pool_node) { - skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - reinterpret_cast(p_alloc_info->descriptorPool), __LINE__, DRAWSTATE_INVALID_POOL, "DS", - "Unable to find pool node for pool 0x%" PRIxLEAST64 " specified in vkAllocateDescriptorSets() call", - reinterpret_cast(p_alloc_info->descriptorPool)); - } else { // Make sure pool has all the available descriptors before calling down chain - // Track number of descriptorSets allowable in this pool - if (pool_node->availableSets < p_alloc_info->descriptorSetCount) { - skip_call |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - reinterpret_cast(pool_node->pool), __LINE__, DRAWSTATE_DESCRIPTOR_POOL_EMPTY, "DS", - "Unable to allocate %u descriptorSets from pool 0x%" PRIxLEAST64 - ". This pool only has %d descriptorSets remaining.", - p_alloc_info->descriptorSetCount, reinterpret_cast(pool_node->pool), pool_node->availableSets); - } - // Determine whether descriptor counts are satisfiable - for (uint32_t i = 0; i < VK_DESCRIPTOR_TYPE_RANGE_SIZE; i++) { - if (ds_data->required_descriptors_by_type[i] > pool_node->availableDescriptorTypeCount[i]) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - reinterpret_cast(pool_node->pool), __LINE__, DRAWSTATE_DESCRIPTOR_POOL_EMPTY, - "DS", "Unable to allocate %u descriptors of type %s from pool 0x%" PRIxLEAST64 - ". This pool only has %d descriptors of this type remaining.", - ds_data->required_descriptors_by_type[i], string_VkDescriptorType(VkDescriptorType(i)), - reinterpret_cast(pool_node->pool), pool_node->availableDescriptorTypeCount[i]); - } + // Track number of descriptorSets allowable in this pool + if (pool_node->availableSets < p_alloc_info->descriptorSetCount) { + skip_call |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, + reinterpret_cast(pool_node->pool), __LINE__, DRAWSTATE_DESCRIPTOR_POOL_EMPTY, "DS", + "Unable to allocate %u descriptorSets from pool 0x%" PRIxLEAST64 ". This pool only has %d descriptorSets remaining.", + p_alloc_info->descriptorSetCount, reinterpret_cast(pool_node->pool), pool_node->availableSets); + } + // Determine whether descriptor counts are satisfiable + for (uint32_t i = 0; i < VK_DESCRIPTOR_TYPE_RANGE_SIZE; i++) { + if (ds_data->required_descriptors_by_type[i] > pool_node->availableDescriptorTypeCount[i]) { + skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, + reinterpret_cast(pool_node->pool), __LINE__, DRAWSTATE_DESCRIPTOR_POOL_EMPTY, + "DS", "Unable to allocate %u descriptors of type %s from pool 0x%" PRIxLEAST64 + ". This pool only has %d descriptors of this type remaining.", + ds_data->required_descriptors_by_type[i], string_VkDescriptorType(VkDescriptorType(i)), + reinterpret_cast(pool_node->pool), pool_node->availableDescriptorTypeCount[i]); } } + return skip_call; } // Decrement allocated sets from the pool and insert new sets into set_map -- cgit v1.2.3