mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 16:50:44 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user