Add a timer for logging overall capture duration & size

This commit is contained in:
baldurk
2020-03-13 10:43:00 +00:00
parent 233c8bfce1
commit 3bfaf929e6
8 changed files with 32 additions and 0 deletions
+6
View File
@@ -1673,6 +1673,8 @@ void WrappedID3D11Device::StartFrameCapture(void *dev, void *wnd)
if(!IsBackgroundCapturing(m_State))
return;
m_CaptureTimer.Restart();
m_State = CaptureState::ActiveCapturing;
m_AppControlledCapture = true;
@@ -1988,6 +1990,10 @@ bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd)
UnlockForChunkFlushing();
}
RDCLOG("Captured D3D11 frame with %f MB capture section in %f seconds",
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
m_CaptureTimer.GetMilliseconds() / 1000.0);
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
m_State = CaptureState::BackgroundCapturing;
+2
View File
@@ -347,6 +347,8 @@ private:
CaptureState m_State;
bool m_AppControlledCapture = false;
PerformanceTimer m_CaptureTimer;
ReplayStatus m_FailedReplayStatus = ReplayStatus::APIReplayFailed;
std::set<ID3D11DeviceChild *> m_CachedStateObjects;
+6
View File
@@ -1778,6 +1778,8 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd)
if(!IsBackgroundCapturing(m_State))
return;
m_CaptureTimer.Restart();
m_AppControlledCapture = true;
m_SubmitCounter = 0;
@@ -2147,6 +2149,10 @@ bool WrappedID3D12Device::EndFrameCapture(void *dev, void *wnd)
RDCDEBUG("Done");
}
RDCLOG("Captured D3D12 frame with %f MB capture section in %f seconds",
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
m_CaptureTimer.GetMilliseconds() / 1000.0);
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
SAFE_DELETE(m_HeaderChunk);
+2
View File
@@ -452,6 +452,8 @@ private:
Threading::RWLock m_CapTransitionLock;
CaptureState m_State;
PerformanceTimer m_CaptureTimer;
uint32_t m_SubmitCounter = 0;
D3D12InitParams m_InitParams;
+6
View File
@@ -2144,6 +2144,8 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd)
if(!IsBackgroundCapturing(m_State))
return;
m_CaptureTimer.Restart();
SCOPED_LOCK(glLock);
m_State = CaptureState::ActiveCapturing;
@@ -2355,6 +2357,10 @@ bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd)
}
}
RDCLOG("Captured GL frame with %f MB capture section in %f seconds",
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
m_CaptureTimer.GetMilliseconds() / 1000.0);
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
m_State = CaptureState::BackgroundCapturing;
+2
View File
@@ -138,6 +138,8 @@ private:
CaptureState m_State;
bool m_AppControlledCapture = false;
PerformanceTimer m_CaptureTimer;
bool m_MarkedActive = false;
bool m_UsesVRMarkers;
+6
View File
@@ -1531,6 +1531,8 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
if(!IsBackgroundCapturing(m_State))
return;
m_CaptureTimer.Restart();
m_AppControlledCapture = true;
m_SubmitCounter = 0;
@@ -2004,6 +2006,10 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd)
}
}
RDCLOG("Captured Vulkan frame with %f MB capture section in %f seconds",
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
m_CaptureTimer.GetMilliseconds() / 1000.0);
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
SAFE_DELETE(m_HeaderChunk);
+2
View File
@@ -279,6 +279,8 @@ private:
CaptureState m_State;
bool m_AppControlledCapture = false;
PerformanceTimer m_CaptureTimer;
bool m_MarkedActive = false;
uint32_t m_SubmitCounter = 0;