aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-10-25 07:43:27 -0600
committerTobin Ehlis <tobine@google.com>2016-10-25 21:01:49 -0600
commit2083721ccdace484e9cf6f820223d2d471e12fd7 (patch)
tree3bfd71ae1493f7829f307b05ae8249f3afd877fc
parent4052946ae557337ff95f3725e879131b1c63f865 (diff)
downloadvulkan-validation-layers-2083721ccdace484e9cf6f820223d2d471e12fd7.tar.gz
layers:Update error enum for duplicate bindings
Add unique error enum for the case where descriptor bindings are duplicated.
-rw-r--r--layers/core_validation.cpp1
-rw-r--r--layers/descriptor_sets.cpp5
-rw-r--r--layers/vk_validation_error_database.txt3
3 files changed, 5 insertions, 4 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index e07929da1..71d140ba5 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -6719,6 +6719,7 @@ VKAPI_ATTR VkResult VKAPI_CALL
CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout) {
layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
+ // TODO: Need to validate create state prior to calling down the chain
VkResult result = dev_data->dispatch_table.CreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout);
if (VK_SUCCESS == result) {
// TODOSC : Capture layout bindings set
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 114899550..0c6747d66 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -33,9 +33,8 @@ cvdescriptorset::DescriptorSetLayout::DescriptorSetLayout(debug_report_data *rep
descriptor_count_ += p_create_info->pBindings[i].descriptorCount;
if (!binding_to_index_map_.emplace(p_create_info->pBindings[i].binding, i).second) {
log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT,
- reinterpret_cast<uint64_t &>(layout_), __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS",
- "duplicated binding number in "
- "VkDescriptorSetLayoutBinding");
+ reinterpret_cast<uint64_t &>(layout_), __LINE__, VALIDATION_ERROR_02345, "DS",
+ "duplicated binding number in VkDescriptorSetLayoutBinding. %s", validation_error_map[VALIDATION_ERROR_02345]);
}
binding_to_global_start_index_map_[p_create_info->pBindings[i].binding] = global_index;
global_index += p_create_info->pBindings[i].descriptorCount ? p_create_info->pBindings[i].descriptorCount - 1 : 0;
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index 2ead003f1..e7a7d983d 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -2290,4 +2290,5 @@ VALIDATION_ERROR_02341~^~U~^~Unknown~^~vkCreateSwapchainKHR~^~For more informati
VALIDATION_ERROR_02342~^~U~^~Unknown~^~vkQueuePresentKHR~^~For more information refer to Vulkan Spec Section '29.6. WSI Swapchain' which states 'If more than one member of pSwapchains was created from a display surface, all display surfaces referenced that refer to the same display must use the same display mode' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueuePresentKHR)~^~
VALIDATION_ERROR_02343~^~U~^~Unknown~^~vkCmdDebugMarkerEndEXT~^~For more information refer to Vulkan Spec Section '32.1.2. Command Buffer Markers' which states 'If the matching vkCmdDebugMarkerBeginEXT command was in a secondary command buffer, the vkCmdDebugMarkerEndEXT must be in the same commandBuffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdDebugMarkerEndEXT)~^~
VALIDATION_ERROR_02344~^~U~^~Unknown~^~vkCreateImage~^~For more information refer to Vulkan Spec Section '11.3. Images' which states 'If imageType is VK_IMAGE_TYPE_3D, arrayLayers must be 1.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageCreateInfo)~^~
-VALIDATION_ERROR_02345~^~U~^~Unknown~^~vkCreateDescriptorSetLayout~^~For more information refer to Vulkan Spec Section '13.2.1. Descriptor Set Layout' which states 'The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkDescriptorSetLayoutCreateInfo)~^~
+VALIDATION_ERROR_02345~^~Y~^~None~^~vkCreateDescriptorSetLayout~^~For more information refer to Vulkan Spec Section '13.2.1. Descriptor Set Layout' which states 'The VkDescriptorSetLayoutBinding::binding members of the elements of the pBindings array must each have different values.' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkDescriptorSetLayoutCreateInfo)~^~
+