diff options
| author | Mark Young <marky@lunarg.com> | 2016-04-11 16:53:53 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-04-14 16:01:47 -0600 |
| commit | d976114de79ff37172009b7bb9bf2f1575500c7a (patch) | |
| tree | b8be435dedb106175745e0eebe566c9ad8533b47 /layers/core_validation.cpp | |
| parent | 26fea8827c2e86b02f41833b3432d7243d6dfead (diff) | |
| download | usermoji-d976114de79ff37172009b7bb9bf2f1575500c7a.tar.xz | |
layers: lx465 update core_validation image layout warning.
If sub-resource data is present, print out that info as part of
the error message when the image layout is incorrect.
Change-Id: Ibd4d95e22d846b823b5c76986e8646624c109bc6
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index c65a838a..ce15dd90 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -4744,13 +4744,24 @@ static bool ValidateCmdBufImageLayouts(VkCommandBuffer cmdBuffer) { if (cb_image_data.second.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED) { // TODO: Set memory invalid which is in mem_tracker currently } else if (imageLayout != cb_image_data.second.initialLayout) { - skip_call |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - reinterpret_cast<uint64_t &>(cmdBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", - "Cannot submit cmd buffer using image (%" PRIx64 ") with layout %s when " - "first use is %s.", - reinterpret_cast<const uint64_t &>(cb_image_data.first.image), string_VkImageLayout(imageLayout), - string_VkImageLayout(cb_image_data.second.initialLayout)); + if (cb_image_data.first.hasSubresource) { + skip_call |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + reinterpret_cast<uint64_t &>(cmdBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + "Cannot submit cmd buffer using image (%" PRIx64 ") [sub-resource: array layer %u, mip level %u], " + "with layout %s when first use is %s.", + reinterpret_cast<const uint64_t &>(cb_image_data.first.image), cb_image_data.first.subresource.arrayLayer, + cb_image_data.first.subresource.mipLevel, string_VkImageLayout(imageLayout), + string_VkImageLayout(cb_image_data.second.initialLayout)); + } else { + skip_call |= log_msg( + dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + reinterpret_cast<uint64_t &>(cmdBuffer), __LINE__, DRAWSTATE_INVALID_IMAGE_LAYOUT, "DS", + "Cannot submit cmd buffer using image (%" PRIx64 ") with layout %s when " + "first use is %s.", + reinterpret_cast<const uint64_t &>(cb_image_data.first.image), string_VkImageLayout(imageLayout), + string_VkImageLayout(cb_image_data.second.initialLayout)); + } } SetLayout(dev_data, cb_image_data.first, cb_image_data.second.layout); } |
