From 00bea5512da3e1ffa60106800c3009d89ebb5165 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 3 Nov 2016 10:46:44 -0600 Subject: [PATCH] layers:Handle secondary cmd buffer transitions When recording a secondary command buffer into a primary command buffer record any image layout transitions from the secondary cb into the primary cb. At QueueSubmit time we validate the layouts at the primary cmd buffer level so this change will allow that code to correctly work if layout transitions occur in the secondary command buffer. --- layers/core_validation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e035445..09d41a9 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11008,6 +11008,10 @@ CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, "supported on this device.", reinterpret_cast(pCommandBuffers[i])); } + // Propagate layout transitions to the primary cmd buffer + for (auto ilm_entry : pSubCB->imageLayoutMap) { + SetLayout(pCB, ilm_entry.first, ilm_entry.second); + } pSubCB->primaryCommandBuffer = pCB->commandBuffer; pCB->secondaryCommandBuffers.insert(pSubCB->commandBuffer); dev_data->globalInFlightCmdBuffers.insert(pSubCB->commandBuffer); -- 2.7.4