layers: Updating descriptor checks to use unique enums
authorTobin Ehlis <tobine@google.com>
Thu, 6 Oct 2016 18:58:06 +0000 (12:58 -0600)
committerTobin Ehlis <tobine@google.com>
Fri, 7 Oct 2016 18:01:41 +0000 (12:01 -0600)
Initial batch of updates to use unique validation error enums and
messages for a few checks. Updated the database file and flagged
some other checks that are missing along with "TODO" notes in the
code.

layers/core_validation.cpp
layers/core_validation.h
layers/descriptor_sets.cpp
layers/descriptor_sets.h
layers/spec.py
layers/vk_validation_error_database.txt
layers/vk_validation_error_messages.h

index b31f6da..33a7106 100644 (file)
@@ -61,7 +61,6 @@
 #include "vk_layer_extension_utils.h"
 #include "vk_layer_utils.h"
 #include "spirv-tools/libspirv.h"
-#include "vk_validation_error_messages.h"
 
 #if defined __ANDROID__
 #include <android/log.h>
@@ -3861,11 +3860,13 @@ static bool validateIdleDescriptorSet(const layer_data *my_data, VkDescriptorSet
                              "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that has not been allocated.", func_str.c_str(),
                              (uint64_t)(set));
     } else {
+        // TODO : This covers various error cases so should pass error enum into this function and use passed in enum here
         if (set_node->second->in_use.load()) {
-            skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
-                                 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, (uint64_t)(set), __LINE__, DRAWSTATE_OBJECT_INUSE,
-                                 "DS", "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that is in use by a command buffer.",
-                                 func_str.c_str(), (uint64_t)(set));
+            skip_call |=
+                log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
+                        (uint64_t)(set), __LINE__, VALIDATION_ERROR_00919, "DS",
+                        "Cannot call %s() on descriptor set 0x%" PRIxLEAST64 " that is in use by a command buffer. %s",
+                        func_str.c_str(), (uint64_t)(set), validation_error_map[VALIDATION_ERROR_00919]);
         }
     }
     return skip_call;
@@ -6055,6 +6056,7 @@ DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetL
 
 VKAPI_ATTR void VKAPI_CALL
 DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator) {
+    // TODO : Add checks for VALIDATION_ERROR_00901
     // TODO : Clean up any internal data structures using this obj.
     get_my_data_ptr(get_dispatch_key(device), layer_data_map)
         ->dispatch_table.DestroyDescriptorPool(device, descriptorPool, pAllocator);
@@ -6632,14 +6634,15 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t
     bool skip_call = false;
     // Check that offset + size don't exceed the max.
     // Prevent arithetic overflow here by avoiding addition and testing in this order.
+    // TODO : This check combines VALIDATION_ERROR_00877 & 880, need to break out separately
     if ((offset >= maxPushConstantsSize) || (size > maxPushConstantsSize - offset)) {
         // This is a pain just to adapt the log message to the caller, but better to sort it out only when there is a problem.
         if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) {
             skip_call |=
                 log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,
-                        DRAWSTATE_PUSH_CONSTANTS_ERROR, "DS", "%s call has push constants index %u with offset %u and size %u that "
-                                                              "exceeds this device's maxPushConstantSize of %u.",
-                        caller_name, index, offset, size, maxPushConstantsSize);
+                        VALIDATION_ERROR_00877, "DS", "%s call has push constants index %u with offset %u and size %u that "
+                                                      "exceeds this device's maxPushConstantSize of %u. %s",
+                        caller_name, index, offset, size, maxPushConstantsSize, validation_error_map[VALIDATION_ERROR_00877]);
         } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) {
             skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,
                                  DRAWSTATE_PUSH_CONSTANTS_ERROR, "DS", "%s call has push constants with offset %u and size %u that "
@@ -6651,13 +6654,13 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t
         }
     }
     // size needs to be non-zero and a multiple of 4.
+    // TODO : This check combines VALIDATION_ERROR_00878 & 879, need to break out separately
     if ((size == 0) || ((size & 0x3) != 0)) {
         if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) {
-            skip_call |=
-                log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,
-                        DRAWSTATE_PUSH_CONSTANTS_ERROR, "DS", "%s call has push constants index %u with "
-                                                              "size %u. Size must be greater than zero and a multiple of 4.",
-                        caller_name, index, size);
+            skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,
+                                 VALIDATION_ERROR_00878, "DS", "%s call has push constants index %u with "
+                                                               "size %u. Size must be greater than zero and a multiple of 4. %s",
+                                 caller_name, index, size, validation_error_map[VALIDATION_ERROR_00878]);
         } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) {
             skip_call |=
                 log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,
@@ -6693,6 +6696,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout(VkDevice device, const VkPip
                                                     const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout) {
     bool skip_call = false;
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
+    // TODO : Add checks for VALIDATION_ERRORS 865-871
     // Push Constant Range checks
     uint32_t i, j;
     for (i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) {
@@ -6827,9 +6831,10 @@ static bool PreCallValidateFreeDescriptorSets(const layer_data *dev_data, VkDesc
     if (pool_node && !(VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT & pool_node->createInfo.flags)) {
         // Can't Free from a NON_FREE pool
         skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
-                             reinterpret_cast<uint64_t &>(pool), __LINE__, DRAWSTATE_CANT_FREE_FROM_NON_FREE_POOL, "DS",
+                             reinterpret_cast<uint64_t &>(pool), __LINE__, VALIDATION_ERROR_00922, "DS",
                              "It is invalid to call vkFreeDescriptorSets() with a pool created without setting "
-                             "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT.");
+                             "VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT. %s",
+                             validation_error_map[VALIDATION_ERROR_00922]);
     }
     return skip_call;
 }
index 7245958..d701903 100644 (file)
@@ -47,6 +47,7 @@
 
 #pragma once
 #include "core_validation_error_enums.h"
+#include "vk_validation_error_messages.h"
 #include "core_validation_types.h"
 #include "descriptor_sets.h"
 #include "vk_layer_logging.h"
index 45fa3e0..653078a 100644 (file)
@@ -1440,21 +1440,23 @@ bool cvdescriptorset::ValidateAllocateDescriptorSets(const debug_report_data *re
     auto pool_node = getPoolNode(dev_data, p_alloc_info->descriptorPool);
     // 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<uint64_t &>(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<uint64_t &>(pool_node->pool), pool_node->availableSets);
+        skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT,
+                             reinterpret_cast<uint64_t &>(pool_node->pool), __LINE__, VALIDATION_ERROR_00911, "DS",
+                             "Unable to allocate %u descriptorSets from pool 0x%" PRIxLEAST64
+                             ". This pool only has %d descriptorSets remaining. %s",
+                             p_alloc_info->descriptorSetCount, reinterpret_cast<uint64_t &>(pool_node->pool),
+                             pool_node->availableSets, validation_error_map[VALIDATION_ERROR_00911]);
     }
     // 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<const uint64_t &>(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.",
+                                 reinterpret_cast<const uint64_t &>(pool_node->pool), __LINE__, VALIDATION_ERROR_00912, "DS",
+                                 "Unable to allocate %u descriptors of type %s from pool 0x%" PRIxLEAST64
+                                 ". This pool only has %d descriptors of this type remaining. %s",
                                  ds_data->required_descriptors_by_type[i], string_VkDescriptorType(VkDescriptorType(i)),
-                                 reinterpret_cast<uint64_t &>(pool_node->pool), pool_node->availableDescriptorTypeCount[i]);
+                                 reinterpret_cast<uint64_t &>(pool_node->pool), pool_node->availableDescriptorTypeCount[i],
+                                 validation_error_map[VALIDATION_ERROR_00912]);
         }
     }
 
index 541f02d..3505516 100644 (file)
@@ -42,6 +42,7 @@
 #endif
 
 #include "core_validation_error_enums.h"
+#include "vk_validation_error_messages.h"
 #include "core_validation_types.h"
 #include "vk_layer_logging.h"
 #include "vk_layer_utils.h"
index f1b23df..5967ff9 100644 (file)
@@ -156,12 +156,13 @@ class Specification:
         file_contents = []
         file_contents.append(self.copyright)
         file_contents.append('\n#pragma once')
+        file_contents.append('#include <unordered_map>')
         file_contents.append('\n// enum values for unique validation error codes')
         file_contents.append('//  Corresponding validation error message for each enum is given in the mapping table below')
         file_contents.append('//  When a given error occurs, these enum values should be passed to the as the messageCode')
         file_contents.append('//  parameter to the PFN_vkDebugReportCallbackEXT function')
         enum_decl = ['enum UNIQUE_VALIDATION_ERROR_CODE {']
-        error_string_map = ['std::unordered_map<int, char const *const> validation_error_map{']
+        error_string_map = ['static std::unordered_map<int, char const *const> validation_error_map{']
         for enum in sorted(self.val_error_dict):
             #print "Header enum is %s" % (enum)
             enum_decl.append('    %s = %d,' % (enum, int(enum.split('_')[-1])))
index 1e1265e..8d371d7 100644 (file)
@@ -871,22 +871,22 @@ VALIDATION_ERROR_00861~^~U~^~Unknown~^~For more information refer to Vulkan Spec
 VALIDATION_ERROR_00862~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'pCreateInfo must be a pointer to a valid VkPipelineLayoutCreateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCreatePipelineLayout)
 VALIDATION_ERROR_00863~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'If pAllocator is not NULL, pAllocator must be a pointer to a valid VkAllocationCallbacks structure' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCreatePipelineLayout)
 VALIDATION_ERROR_00864~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'pPipelineLayout must be a pointer to a VkPipelineLayout handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCreatePipelineLayout)
-VALIDATION_ERROR_00865~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'setLayoutCount must be less than or equal to VkPhysicalDeviceLimits::maxBoundDescriptorSets' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00866~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00867~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00868~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00869~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00870~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00871~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'Any two elements of pPushConstantRanges must not include the same stage in stageFlags' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00865~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'setLayoutCount must be less than or equal to VkPhysicalDeviceLimits::maxBoundDescriptorSets' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00866~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_SAMPLER and VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSamplers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00867~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00868~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00869~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorSampledImages' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00870~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
+VALIDATION_ERROR_00871~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'Any two elements of pPushConstantRanges must not include the same stage in stageFlags' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
 VALIDATION_ERROR_00872~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'sType must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
 VALIDATION_ERROR_00873~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
 VALIDATION_ERROR_00874~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
 VALIDATION_ERROR_00875~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'If setLayoutCount is not 0, pSetLayouts must be a pointer to an array of setLayoutCount valid VkDescriptorSetLayout handles' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
 VALIDATION_ERROR_00876~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'If pushConstantRangeCount is not 0, pPushConstantRanges must be a pointer to an array of pushConstantRangeCount valid VkPushConstantRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPipelineLayoutCreateInfo)
-VALIDATION_ERROR_00877~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
-VALIDATION_ERROR_00878~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
-VALIDATION_ERROR_00879~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
-VALIDATION_ERROR_00880~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
+VALIDATION_ERROR_00877~^~Y~^~InvalidPushConstants~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
+VALIDATION_ERROR_00878~^~Y~^~InvalidPushConstants~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
+VALIDATION_ERROR_00879~^~Y~^~InvalidPushConstants~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be a multiple of 4' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
+VALIDATION_ERROR_00880~^~Y~^~InvalidPushConstants~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
 VALIDATION_ERROR_00881~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'stageFlags must be a valid combination of VkShaderStageFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
 VALIDATION_ERROR_00882~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'stageFlags must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkPushConstantRange)
 VALIDATION_ERROR_00883~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.2. Pipeline Layouts' which states 'If VkAllocationCallbacks were provided when pipelineLayout was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyPipelineLayout)
@@ -907,7 +907,7 @@ VALIDATION_ERROR_00897~^~U~^~Unknown~^~For more information refer to Vulkan Spec
 VALIDATION_ERROR_00898~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'poolSizeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorPoolCreateFlagBits)
 VALIDATION_ERROR_00899~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorPoolSize)
 VALIDATION_ERROR_00900~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'type must be a valid VkDescriptorType value' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorPoolSize)
-VALIDATION_ERROR_00901~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyDescriptorPool)
+VALIDATION_ERROR_00901~^~N~^~None~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'All submitted commands that refer to descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyDescriptorPool)
 VALIDATION_ERROR_00902~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'If VkAllocationCallbacks were provided when descriptorPool was created, a compatible set of callbacks must be provided here' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyDescriptorPool)
 VALIDATION_ERROR_00903~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'If no VkAllocationCallbacks were provided when descriptorPool was created, pAllocator must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyDescriptorPool)
 VALIDATION_ERROR_00904~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroyDescriptorPool)
@@ -917,18 +917,18 @@ VALIDATION_ERROR_00907~^~U~^~Unknown~^~For more information refer to Vulkan Spec
 VALIDATION_ERROR_00908~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkAllocateDescriptorSets)
 VALIDATION_ERROR_00909~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'pAllocateInfo must be a pointer to a valid VkDescriptorSetAllocateInfo structure' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkAllocateDescriptorSets)
 VALIDATION_ERROR_00910~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'pDescriptorSets must be a pointer to an array of pAllocateInfo::descriptorSetCount VkDescriptorSet handles' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkAllocateDescriptorSets)
-VALIDATION_ERROR_00911~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
-VALIDATION_ERROR_00912~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
+VALIDATION_ERROR_00911~^~Y~^~None~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
+VALIDATION_ERROR_00912~^~Y~^~AllocDescriptorFromEmptyPool~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00913~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00914~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00915~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00916~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'pSetLayouts must be a pointer to an array of descriptorSetCount valid VkDescriptorSetLayout handles' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00917~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
 VALIDATION_ERROR_00918~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'Both of descriptorPool, and the elements of pSetLayouts must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)
-VALIDATION_ERROR_00919~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'All submitted commands that refer to any element of pDescriptorSets must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
+VALIDATION_ERROR_00919~^~Y~^~InvalidCmdBufferDescriptorSetImageSamplerDestroyed~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'All submitted commands that refer to any element of pDescriptorSets must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
 VALIDATION_ERROR_00920~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'pDescriptorSets must be a pointer to an array of descriptorSetCount VkDescriptorSet handles, each element of which must either be a valid handle or VK_NULL_HANDLE' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
 VALIDATION_ERROR_00921~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'Each valid handle in pDescriptorSets must have been allocated from descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
-VALIDATION_ERROR_00922~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
+VALIDATION_ERROR_00922~^~Y~^~FreeDescriptorFromOneShotPool~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must have been created with the VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
 VALIDATION_ERROR_00923~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
 VALIDATION_ERROR_00924~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
 VALIDATION_ERROR_00925~^~U~^~Unknown~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkFreeDescriptorSets)
index d8a8b14..80cb912 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #pragma once
+#include <unordered_map>
 
 // enum values for unique validation error codes
 //  Corresponding validation error message for each enum is given in the mapping table below
@@ -1726,7 +1727,7 @@ enum UNIQUE_VALIDATION_ERROR_CODE {
 // Mapping from unique validation error enum to the corresponding error message
 // The error message should be appended to the end of a custom error message that is passed
 // as the pMessage parameter to the PFN_vkDebugReportCallbackEXT function
-std::unordered_map<int, char const *const> validation_error_map{
+static std::unordered_map<int, char const *const> validation_error_map{
     {VALIDATION_ERROR_00000, "For more information refer to Vulkan Spec Section '3.1. Command Function Pointers' which states 'If instance is not NULL, instance must be a valid VkInstance handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#id-1.5.3.8)"},
     {VALIDATION_ERROR_00001, "For more information refer to Vulkan Spec Section '3.1. Command Function Pointers' which states 'pName must be a null-terminated string' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#id-1.5.3.8)"},
     {VALIDATION_ERROR_00002, "For more information refer to Vulkan Spec Section '3.1. Command Function Pointers' which states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#id-1.5.3.15)"},