Add support for capturing the first frame in Vulkan.

* Defined as beginning at the creation of the first swapchain, to the
  first Present().
* This is mostly useful for samples that don't enter a proper present
  loop and just present once before exiting.
This commit is contained in:
baldurk
2016-06-17 17:13:51 +02:00
parent 10629ab92b
commit 4516120293
3 changed files with 17 additions and 0 deletions
+13
View File
@@ -852,6 +852,19 @@ void WrappedVulkan::AttemptCapture()
}
}
void WrappedVulkan::FirstFrame(VkSwapchainKHR swap)
{
SwapchainInfo *swapdesc = GetRecord(swap)->swapInfo;
// if we have to capture the first frame, begin capturing immediately
if(m_State == WRITING_IDLE && RenderDoc::Inst().ShouldTriggerCapture(0))
{
RenderDoc::Inst().StartFrameCapture(LayerDisp(m_Instance), swapdesc ? swapdesc->wndHandle : NULL);
m_AppControlledCapture = false;
}
}
bool WrappedVulkan::Serialise_BeginCaptureFrame(bool applyInitialState)
{
if(m_State < WRITING && !applyInitialState)
+2
View File
@@ -494,6 +494,8 @@ private:
void FinishCapture();
void EndCaptureFrame(VkImage presentImage);
void FirstFrame(VkSwapchainKHR swap);
string MakeRenderPassOpString(bool store);
void StartFrameCapture(void *dev, void *wnd);
@@ -471,6 +471,8 @@ VkResult WrappedVulkan::vkCreateSwapchainKHR(VkDevice device,
SAFE_DELETE_ARRAY(images);
}
FirstFrame(*pSwapChain);
}
else
{