From 78913345f1dadcd6a226cffbad28c07bf1c34322 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sun, 13 Dec 2015 15:34:48 +0100 Subject: [PATCH] Apply initial contents on first read after setting up image layouts --- renderdoc/driver/vulkan/vk_core.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 6d33301e8..03c183694 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -1121,14 +1121,7 @@ void WrappedVulkan::ReadLogInitialisation() RenderDoc::Inst().SetProgress(FileInitialRead, float(m_pSerialiser->GetOffset())/float(m_pSerialiser->GetSize())); if(context == CAPTURE_SCOPE) - { - GetResourceManager()->ApplyInitialContents(); - - SubmitCmds(); - FlushQ(); - ContextReplayLog(READING, 0, 0, false); - } uint64_t offset2 = m_pSerialiser->GetOffset(); @@ -1182,6 +1175,16 @@ void WrappedVulkan::ContextReplayLog(LogState readType, uint32_t startEventID, u ObjDisp(GetDev())->DeviceWaitIdle(Unwrap(GetDev())); + // apply initial contents here so that images are in the right layout + // (not undefined) + if(readType == READING) + { + GetResourceManager()->ApplyInitialContents(); + + SubmitCmds(); + FlushQ(); + } + m_pSerialiser->PopContext(header); m_RootEvents.clear();