Ensure frame counter has sane values even if Present() isn't called

* This means when someone has no swapchain and is doing off-screen
  rendering, the frame number won't just stick at 0, but it will at
  least be 1 for the first capture, 2 for the second, etc.
This commit is contained in:
baldurk
2016-05-02 00:51:00 +02:00
parent d98c29b1d5
commit cda850ea51
3 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -2512,7 +2512,9 @@ void WrappedID3D11Device::StartFrameCapture(void *dev, void *wnd)
m_Failures = 0;
m_FailedFrame = 0;
m_FailedReason = CaptureSucceeded;
m_FrameCounter = RDCMAX(1+(uint32_t)m_CapturedFrames.size(), m_FrameCounter);
FetchFrameInfo frame;
frame.frameNumber = m_FrameCounter+1;
frame.captureTime = Timing::GetUnixTimestamp();
+3 -1
View File
@@ -2349,7 +2349,9 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd)
GLWindowingData prevctx = m_ActiveContexts[Threading::GetCurrentID()];
GLWindowingData switchctx = prevctx;
MakeValidContextCurrent(switchctx, wnd);
m_FrameCounter = RDCMAX(1+(uint32_t)m_CapturedFrames.size(), m_FrameCounter);
FetchFrameInfo frame;
frame.frameNumber = m_FrameCounter+1;
frame.captureTime = Timing::GetUnixTimestamp();
+2
View File
@@ -863,6 +863,8 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
RenderDoc::Inst().SetCurrentDriver(RDC_Vulkan);
m_AppControlledCapture = true;
m_FrameCounter = RDCMAX(1+(uint32_t)m_CapturedFrames.size(), m_FrameCounter);
FetchFrameInfo frame;
frame.frameNumber = m_FrameCounter+1;