diff options
| author | Mike Schuchardt <mikes@lunarg.com> | 2016-12-06 10:56:01 -0700 |
|---|---|---|
| committer | Mike Schuchardt <mikes@lunarg.com> | 2016-12-09 13:55:54 -0700 |
| commit | a4bb113610b88cff1ae2f713749adfc75c36d58b (patch) | |
| tree | ded5f732a0634332f7fc9f43e0b4ba96fd9cb58a | |
| parent | 39b5347ef7c5a6367d4c9f7f5ae8ee3a2bab92c6 (diff) | |
| download | usermoji-a4bb113610b88cff1ae2f713749adfc75c36d58b.tar.xz | |
layers: Add error enums to object tracker
Add the following validation error enums to object tracker helper
functions:
VALIDATION_ERROR_00097
VALIDATION_ERROR_00102
VALIDATION_ERROR_00920
VALIDATION_ERROR_00927
VALIDATION_ERROR_01651
Change-Id: Ic21fbaf14f29aef53b2b24d0aa4a8577d3a11927
| -rw-r--r-- | layers/object_tracker.cpp | 35 | ||||
| -rw-r--r-- | layers/vk_validation_error_database.txt | 10 |
2 files changed, 24 insertions, 21 deletions
diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp index b3a086d6..6a493fb5 100644 --- a/layers/object_tracker.cpp +++ b/layers/object_tracker.cpp @@ -107,8 +107,9 @@ static void ValidateQueueFlags(VkQueue queue, const char *function) { if ((instance_data->queue_family_properties[pQueueInfo->queue_node_index].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) == 0) { log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - reinterpret_cast<uint64_t>(queue), __LINE__, OBJTRACK_UNKNOWN_OBJECT, LayerName, - "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_SPARSE_BINDING_BIT not set", function); + reinterpret_cast<uint64_t>(queue), __LINE__, VALIDATION_ERROR_01651, LayerName, + "Attempting %s on a non-memory-management capable queue -- VK_QUEUE_SPARSE_BINDING_BIT not set. %s", + function, validation_error_map[VALIDATION_ERROR_01651]); } } } @@ -147,17 +148,18 @@ static bool ValidateCommandBuffer(VkDevice device, VkCommandPool command_pool, V if (pNode->parent_object != reinterpret_cast<uint64_t &>(command_pool)) { skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, pNode->object_type, object_handle, - __LINE__, OBJTRACK_COMMAND_POOL_MISMATCH, LayerName, + __LINE__, VALIDATION_ERROR_00102, LayerName, "FreeCommandBuffers is attempting to free Command Buffer 0x%" PRIxLEAST64 - " belonging to Command Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 ").", + " belonging to Command Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 "). %s", reinterpret_cast<uint64_t>(command_buffer), pNode->parent_object, - reinterpret_cast<uint64_t &>(command_pool)); + reinterpret_cast<uint64_t &>(command_pool), validation_error_map[VALIDATION_ERROR_00102]); } } else { - skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, - __LINE__, OBJTRACK_NONE, LayerName, "Unable to remove command buffer obj 0x%" PRIxLEAST64 - ". Was it created? Has it already been destroyed?", - object_handle); + skip_call |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + object_handle, __LINE__, VALIDATION_ERROR_00097, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s", + object_name[VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT], object_handle, + validation_error_map[VALIDATION_ERROR_00097]); } return skip_call; } @@ -192,17 +194,18 @@ static bool ValidateDescriptorSet(VkDevice device, VkDescriptorPool descriptor_p if (pNode->parent_object != reinterpret_cast<uint64_t &>(descriptor_pool)) { skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, pNode->object_type, object_handle, - __LINE__, OBJTRACK_DESCRIPTOR_POOL_MISMATCH, LayerName, + __LINE__, VALIDATION_ERROR_00927, LayerName, "FreeDescriptorSets is attempting to free descriptorSet 0x%" PRIxLEAST64 - " belonging to Descriptor Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 ").", + " belonging to Descriptor Pool 0x%" PRIxLEAST64 " from pool 0x%" PRIxLEAST64 "). %s", reinterpret_cast<uint64_t &>(descriptor_set), pNode->parent_object, - reinterpret_cast<uint64_t &>(descriptor_pool)); + reinterpret_cast<uint64_t &>(descriptor_pool), validation_error_map[VALIDATION_ERROR_00927]); } } else { - skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, - __LINE__, OBJTRACK_NONE, LayerName, "Unable to remove descriptor set obj 0x%" PRIxLEAST64 - ". Was it created? Has it already been destroyed?", - object_handle); + skip_call |= + log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + object_handle, __LINE__, VALIDATION_ERROR_00920, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s", + object_name[VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT], object_handle, + validation_error_map[VALIDATION_ERROR_00920]); } return skip_call; } diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index e351d426..04850eef 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -100,12 +100,12 @@ VALIDATION_ERROR_00093~^~U~^~Unknown~^~vkResetCommandBuffer~^~For more informati VALIDATION_ERROR_00094~^~U~^~Unknown~^~vkResetCommandBuffer~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkCommandBufferResetFlagBits)~^~ VALIDATION_ERROR_00095~^~N~^~Unknown~^~vkResetCommandBuffer~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'flags must be a valid combination of VkCommandBufferResetFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkCommandBufferResetFlagBits)~^~TBD in parameter validation layer. VALIDATION_ERROR_00096~^~Y~^~None~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'All elements of pCommandBuffers must not be pending execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ -VALIDATION_ERROR_00097~^~U~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'pCommandBuffers must be a pointer to an array of commandBufferCount VkCommandBuffer handles, each element of which must either be a valid handle or NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ +VALIDATION_ERROR_00097~^~Y~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'pCommandBuffers must be a pointer to an array of commandBufferCount VkCommandBuffer handles, each element of which must either be a valid handle or NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ VALIDATION_ERROR_00098~^~Y~^~None~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'device must be a valid VkDevice handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ VALIDATION_ERROR_00099~^~Y~^~None~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'commandPool must be a valid VkCommandPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ VALIDATION_ERROR_00100~^~U~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'commandBufferCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ VALIDATION_ERROR_00101~^~U~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'commandPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ -VALIDATION_ERROR_00102~^~U~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'Each element of pCommandBuffers that is a valid handle must have been created, allocated, or retrieved from commandPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ +VALIDATION_ERROR_00102~^~Y~^~Unknown~^~vkFreeCommandBuffers~^~For more information refer to Vulkan Spec Section '5.2. Command Buffer Allocation and Management' which states 'Each element of pCommandBuffers that is a valid handle must have been created, allocated, or retrieved from commandPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeCommandBuffers)~^~ VALIDATION_ERROR_00103~^~U~^~Unknown~^~vkBeginCommandBuffer~^~For more information refer to Vulkan Spec Section '5.3. Command Buffer Recording' which states 'commandBuffer must not be in the recording state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkBeginCommandBuffer)~^~ VALIDATION_ERROR_00104~^~U~^~Unknown~^~vkBeginCommandBuffer~^~For more information refer to Vulkan Spec Section '5.3. Command Buffer Recording' which states 'commandBuffer must not currently be pending execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkBeginCommandBuffer)~^~ VALIDATION_ERROR_00105~^~U~^~Unknown~^~vkBeginCommandBuffer~^~For more information refer to Vulkan Spec Section '5.3. Command Buffer Recording' which states 'If commandBuffer was allocated from a VkCommandPool which did not have the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag set, commandBuffer must be in the initial state' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkBeginCommandBuffer)~^~ @@ -909,14 +909,14 @@ VALIDATION_ERROR_00916~^~Y~^~None~^~vkAllocateDescriptorSets~^~For more informat VALIDATION_ERROR_00917~^~U~^~Unknown~^~vkAllocateDescriptorSets~^~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-extensions/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)~^~ VALIDATION_ERROR_00918~^~U~^~Unknown~^~vkAllocateDescriptorSets~^~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-extensions/xhtml/vkspec.html#VkDescriptorSetAllocateInfo)~^~ VALIDATION_ERROR_00919~^~Y~^~InvalidCmdBufferDescriptorSetImageSamplerDestroyed~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ -VALIDATION_ERROR_00920~^~U~^~Unknown~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ +VALIDATION_ERROR_00920~^~Y~^~Unknown~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00921~^~U~^~Unknown~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00922~^~Y~^~FreeDescriptorFromOneShotPool~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00923~^~Y~^~None~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00924~^~Y~^~None~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00925~^~U~^~Unknown~^~vkFreeDescriptorSets~^~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-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00926~^~U~^~Unknown~^~vkFreeDescriptorSets~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'descriptorPool must have been created, allocated, or retrieved from device' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ -VALIDATION_ERROR_00927~^~U~^~Unknown~^~vkFreeDescriptorSets~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'Each element of pDescriptorSets that is a valid handle must have been created, allocated, or retrieved from descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ +VALIDATION_ERROR_00927~^~Y~^~Unknown~^~vkFreeDescriptorSets~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'Each element of pDescriptorSets that is a valid handle must have been created, allocated, or retrieved from descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkFreeDescriptorSets)~^~ VALIDATION_ERROR_00928~^~U~^~Unknown~^~vkResetDescriptorPool~^~For more information refer to Vulkan Spec Section '13.2.3. Allocation of Descriptor Sets' which states 'All uses of descriptorPool (via any allocated descriptor sets) must have completed execution' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkResetDescriptorPool)~^~ VALIDATION_ERROR_00929~^~Y~^~None~^~vkResetDescriptorPool~^~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-extensions/xhtml/vkspec.html#vkResetDescriptorPool)~^~ VALIDATION_ERROR_00930~^~Y~^~InvalidDescriptorPool~^~vkResetDescriptorPool~^~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-extensions/xhtml/vkspec.html#vkResetDescriptorPool)~^~ @@ -1606,7 +1606,7 @@ VALIDATION_ERROR_01647~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information VALIDATION_ERROR_01648~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'queue must be a valid VkQueue handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ VALIDATION_ERROR_01649~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'If bindInfoCount is not 0, pBindInfo must be a pointer to an array of bindInfoCount valid VkBindSparseInfo structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ VALIDATION_ERROR_01650~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'If fence is not VK_NULL_HANDLE, fence must be a valid VkFence handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ -VALIDATION_ERROR_01651~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'The queue must support sparse binding operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ +VALIDATION_ERROR_01651~^~Y~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'The queue must support sparse binding operations' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ VALIDATION_ERROR_01652~^~U~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'Both of fence, and queue that are valid handles must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkQueueBindSparse)~^~ VALIDATION_ERROR_01653~^~N~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'sType must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkBindSparseInfo)~^~TBD in parameter validation layer. VALIDATION_ERROR_01654~^~N~^~Unknown~^~vkQueueBindSparse~^~For more information refer to Vulkan Spec Section '29.7.6. Binding Resource Memory' which states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkBindSparseInfo)~^~TBD in parameter validation layer. |
