layers: Properly set secondary cmd buffer inherited items.
authorMark Young <marky@lunarg.com>
Fri, 6 May 2016 19:48:26 +0000 (13:48 -0600)
committerTobin Ehlis <tobine@google.com>
Mon, 9 May 2016 14:29:29 +0000 (08:29 -0600)
We failed to inherit the proper items in the secondary cmd buffer
in the core_validation layer when the
VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT bit was set.

Change-Id: I01579d889dde8e0d331ed5a65eb48ce7185d3d82

layers/core_validation.cpp

index 19cb0a3..22573b4 100644 (file)
@@ -6152,6 +6152,13 @@ vkBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginIn
         if (pCB->beginInfo.pInheritanceInfo) {
             pCB->inheritanceInfo = *(pCB->beginInfo.pInheritanceInfo);
             pCB->beginInfo.pInheritanceInfo = &pCB->inheritanceInfo;
+            // If we are a secondary command-buffer and inheriting.  Update the items we should inherit.
+            if ((pCB->createInfo.level != VK_COMMAND_BUFFER_LEVEL_PRIMARY) &&
+                (pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT)) {
+                pCB->activeRenderPass = pCB->beginInfo.pInheritanceInfo->renderPass;
+                pCB->activeSubpass = pCB->beginInfo.pInheritanceInfo->subpass;
+                pCB->framebuffers.insert(pCB->beginInfo.pInheritanceInfo->framebuffer);
+            }
         }
     } else {
         skipCall |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,