aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-12-01 15:59:53 -0700
committerTobin Ehlis <tobine@google.com>2017-12-04 16:54:00 -0700
commit5cdcae6743d24f1a54ff6af94f6ecc130fbd5987 (patch)
tree5e7c3f7ef33c9fa503ad64dfec61b16fa7d8a280 /layers/core_validation.cpp
parent9bd006d688830ea1c2301699f3933686103597c6 (diff)
downloadusermoji-5cdcae6743d24f1a54ff6af94f6ecc130fbd5987.tar.xz
layers:Limit warning on secondary command buffer
Only warn if a secondary command buffer has a renderPass that is valid and has not set VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT. This avoid warning for the case where uninitialized data is present in the renderPass handle.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index c78feff9..f6b8d44f 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -5204,15 +5204,16 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer,
cb_node->framebuffers.insert(cb_node->beginInfo.pInheritanceInfo->framebuffer);
} else if (VK_NULL_HANDLE != cb_node->beginInfo.pInheritanceInfo->renderPass) {
// This is a user-requested warning. This is a likely case where user forgot to set RP continue bit
- skip |=
- log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
- HandleToUint64(cb_node->beginInfo.pInheritanceInfo->renderPass), __LINE__,
- VALIDATION_ERROR_0280006a, "CORE",
- "vkBeginCommandBuffer(): Secondary command buffer with a non-null pInheritanceInfo->renderPass "
- "does not have "
- "VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT. If you intend to draw from this command buffer "
- "you must set "
- "VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT in pBeginInfo->flags.");
+ // but only warn if renderPass actually exists, indicating this was intentional vs just uninitialized junk
+ if (GetRenderPassState(dev_data, cb_node->beginInfo.pInheritanceInfo->renderPass)) {
+ skip |= log_msg(
+ dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
+ HandleToUint64(cb_node->beginInfo.pInheritanceInfo->renderPass), __LINE__, VALIDATION_ERROR_0280006a,
+ "CORE",
+ "vkBeginCommandBuffer(): Secondary command buffer with a non-null pInheritanceInfo->renderPass "
+ "does not have VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT. If you intend to draw from this "
+ "command buffer you must set VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT in pBeginInfo->flags.");
+ }
}
}
}