diff options
| author | Tobin Ehlis <tobine@google.com> | 2017-11-28 15:02:29 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-12-01 15:04:14 -0700 |
| commit | 058d399edd20a09a3f9b1ae39c374a244978ffdc (patch) | |
| tree | 7263ecebdfbdb3df4eec36e3288d27e1529e7f18 /layers/core_validation.cpp | |
| parent | a0d515350ac7d57c4ab546b52105e13bb251eb05 (diff) | |
| download | usermoji-058d399edd20a09a3f9b1ae39c374a244978ffdc.tar.xz | |
layers:Add secondary CB warning
Fixes #2237
If VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not set by a
secondary command buffer, then any renderPass specified in the
inheritance info will be ignored. Adding a warning if a non-NULL
renderPass is included in the inheritance info but the
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not set. This is
likely an oversight by the user and the current validation error that
this case leads to (no active renderPass) doesn't directly point to the
root cause.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e08ca129..769c65f2 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5200,12 +5200,24 @@ VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer(VkCommandBuffer commandBuffer, cb_node->inheritanceInfo = *(cb_node->beginInfo.pInheritanceInfo); cb_node->beginInfo.pInheritanceInfo = &cb_node->inheritanceInfo; // If we are a secondary command-buffer and inheriting. Update the items we should inherit. - if ((cb_node->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) && - (cb_node->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)) { - cb_node->activeRenderPass = GetRenderPassState(dev_data, cb_node->beginInfo.pInheritanceInfo->renderPass); - cb_node->activeSubpass = cb_node->beginInfo.pInheritanceInfo->subpass; - cb_node->activeFramebuffer = cb_node->beginInfo.pInheritanceInfo->framebuffer; - cb_node->framebuffers.insert(cb_node->beginInfo.pInheritanceInfo->framebuffer); + if (cb_node->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) { + if (cb_node->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { + cb_node->activeRenderPass = GetRenderPassState(dev_data, cb_node->beginInfo.pInheritanceInfo->renderPass); + cb_node->activeSubpass = cb_node->beginInfo.pInheritanceInfo->subpass; + cb_node->activeFramebuffer = cb_node->beginInfo.pInheritanceInfo->framebuffer; + 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."); + } } } } |
