From 51defeb76e4e5e2f889bee62a9b54c251e3be77a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 27 Oct 2016 09:32:34 +1300 Subject: layers: Tweak CmdClearAttachment handling for error DB - Align the 'ignored' cases with the 1.0.32 spec - Use unique error enums in the error cases. - 01125 isn't a perfect match for what I was trying to fix with this change, but the code does cover the VU statement. Possibly an area we can adjust in the spec. V2: - Set test names properly too. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 19 ++++++++++--------- layers/vk_validation_error_database.txt | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 761d0aab..74326895 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8661,15 +8661,15 @@ VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, ui if (clear_desc->colorAttachment >= pSD->colorAttachmentCount) { skip_call |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - (uint64_t)commandBuffer, __LINE__, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS", - "vkCmdClearAttachments() color attachment index %d out of range for active subpass %d; ignored", - clear_desc->colorAttachment, pCB->activeSubpass); + (uint64_t)commandBuffer, __LINE__, VALIDATION_ERROR_01114, "DS", + "vkCmdClearAttachments() color attachment index %d out of range for active subpass %d. %s", + clear_desc->colorAttachment, pCB->activeSubpass, validation_error_map[VALIDATION_ERROR_01114]); } else if (pSD->pColorAttachments[clear_desc->colorAttachment].attachment == VK_ATTACHMENT_UNUSED) { skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + dev_data->report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)commandBuffer, __LINE__, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS", - "vkCmdClearAttachments() color attachment index %d is VK_ATTACHMENT_UNUSED; ignored", + "vkCmdClearAttachments() color attachment index %d is VK_ATTACHMENT_UNUSED; ignored.", clear_desc->colorAttachment); } else { @@ -8681,7 +8681,7 @@ VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, ui VK_ATTACHMENT_UNUSED)) { // Says no DS will be used in active subpass skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + dev_data->report_data, VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)commandBuffer, __LINE__, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS", "vkCmdClearAttachments() depth/stencil clear with no depth/stencil attachment in subpass; ignored"); } @@ -8698,9 +8698,10 @@ VKAPI_ATTR void VKAPI_CALL CmdClearAttachments(VkCommandBuffer commandBuffer, ui if (extra_aspects) { skip_call |= log_msg( dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT, - reinterpret_cast(image_view), __LINE__, DRAWSTATE_INVALID_IMAGE_ASPECT, "DS", - "vkCmdClearAttachments() with aspects not present in image view: %s", - string_VkImageAspectFlagBits((VkImageAspectFlagBits)extra_aspects)); + reinterpret_cast(image_view), __LINE__, VALIDATION_ERROR_01125, "DS", + "vkCmdClearAttachments() with aspects not present in image view: %s. %s", + string_VkImageAspectFlagBits((VkImageAspectFlagBits)extra_aspects), + validation_error_map[VALIDATION_ERROR_01125]); } } } diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index 35816da6..7cbfc10c 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -1104,7 +1104,7 @@ VALIDATION_ERROR_01110~^~U~^~Unknown~^~vkCmdClearDepthStencilImage~^~For more in VALIDATION_ERROR_01111~^~U~^~Unknown~^~vkCmdClearDepthStencilImage~^~For more information refer to Vulkan Spec Section '17.1. Clearing Images Outside A Render Pass Instance' which states 'This command must only be called outside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearDepthStencilImage)~^~ VALIDATION_ERROR_01112~^~U~^~Unknown~^~vkCmdClearDepthStencilImage~^~For more information refer to Vulkan Spec Section '17.1. Clearing Images Outside A Render Pass Instance' which states 'rangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearDepthStencilImage)~^~ VALIDATION_ERROR_01113~^~U~^~Unknown~^~vkCmdClearDepthStencilImage~^~For more information refer to Vulkan Spec Section '17.1. Clearing Images Outside A Render Pass Instance' which states 'Both of commandBuffer, and image must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearDepthStencilImage)~^~ -VALIDATION_ERROR_01114~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'If the aspectMask member of any given element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, the colorAttachment member of those elements must refer to a valid color attachment in the current subpass' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ +VALIDATION_ERROR_01114~^~Y~^~MissingClearAttachment~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'If the aspectMask member of any given element of pAttachments contains VK_IMAGE_ASPECT_COLOR_BIT, the colorAttachment member of those elements must refer to a valid color attachment in the current subpass' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ VALIDATION_ERROR_01115~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'The rectangular region specified by a given element of pRects must be contained within the render area of the current render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ VALIDATION_ERROR_01116~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'The layers specified by a given element of pRects must be contained within every attachment that pAttachments refers to' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ VALIDATION_ERROR_01117~^~Y~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'commandBuffer must be a valid VkCommandBuffer handle' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ @@ -1115,7 +1115,7 @@ VALIDATION_ERROR_01121~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more informat VALIDATION_ERROR_01122~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'This command must only be called inside of a render pass instance' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ VALIDATION_ERROR_01123~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'attachmentCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ VALIDATION_ERROR_01124~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'rectCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdClearAttachments)~^~ -VALIDATION_ERROR_01125~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkClearAttachment)~^~ +VALIDATION_ERROR_01125~^~Y~^~None~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'If aspectMask includes VK_IMAGE_ASPECT_COLOR_BIT, it must not include VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkClearAttachment)~^~ VALIDATION_ERROR_01126~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'aspectMask must not include VK_IMAGE_ASPECT_METADATA_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkClearAttachment)~^~ VALIDATION_ERROR_01127~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'aspectMask must be a valid combination of VkImageAspectFlagBits values' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkClearAttachment)~^~ VALIDATION_ERROR_01128~^~U~^~Unknown~^~vkCmdClearAttachments~^~For more information refer to Vulkan Spec Section '17.2. Clearing Images Inside A Render Pass Instance' which states 'aspectMask must not be 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkClearAttachment)~^~ -- cgit v1.2.3