diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index ea8e5b02e..dfbccebd4 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -1652,6 +1652,8 @@ void WrappedID3D11Device::StartFrameCapture(void *dev, void *wnd) if(!IsBackgroundCapturing(m_State)) return; + RDCLOG("Starting capture"); + m_CaptureTimer.Restart(); m_State = CaptureState::ActiveCapturing; @@ -1698,8 +1700,6 @@ void WrappedID3D11Device::StartFrameCapture(void *dev, void *wnd) if(m_pInfoQueue) m_pInfoQueue->ClearStoredMessages(); - - RDCLOG("Starting capture, frame %u", m_CapturedFrames.back().frameNumber); } bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd) @@ -2133,6 +2133,8 @@ bool WrappedID3D11Device::DiscardFrameCapture(void *dev, void *wnd) if(!IsActiveCapturing(m_State)) return true; + RDCLOG("Discarding frame capture."); + RenderDoc::Inst().FinishCaptureWriting(NULL, m_CapturedFrames.back().frameNumber); m_pImmediateContext->CleanupCapture(); diff --git a/renderdoc/driver/d3d12/d3d12_device.cpp b/renderdoc/driver/d3d12/d3d12_device.cpp index 9448e4507..e2a116966 100644 --- a/renderdoc/driver/d3d12/d3d12_device.cpp +++ b/renderdoc/driver/d3d12/d3d12_device.cpp @@ -1765,6 +1765,8 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd) if(!IsBackgroundCapturing(m_State)) return; + RDCLOG("Starting capture"); + m_CaptureTimer.Restart(); m_AppControlledCapture = true; @@ -1839,8 +1841,6 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd) } GetResourceManager()->MarkResourceFrameReferenced(m_ResourceID, eFrameRef_Read); - - RDCLOG("Starting capture, frame %u", m_CapturedFrames.back().frameNumber); } bool WrappedID3D12Device::EndFrameCapture(void *dev, void *wnd) @@ -2177,6 +2177,8 @@ bool WrappedID3D12Device::DiscardFrameCapture(void *dev, void *wnd) if(!IsActiveCapturing(m_State)) return true; + RDCLOG("Discarding frame capture."); + RenderDoc::Inst().FinishCaptureWriting(NULL, m_CapturedFrames.back().frameNumber); m_CapturedFrames.pop_back(); diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 66016d324..a32bdd115 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -2156,6 +2156,8 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd) if(!IsBackgroundCapturing(m_State)) return; + RDCLOG("Starting capture"); + m_CaptureTimer.Restart(); SCOPED_LOCK(glLock); @@ -2209,8 +2211,6 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd) m_ActiveContexts[Threading::GetCurrentID()] = existing; } - - RDCLOG("Starting capture, frame %u", m_CapturedFrames.back().frameNumber); } bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd) @@ -2503,6 +2503,8 @@ bool WrappedOpenGL::DiscardFrameCapture(void *dev, void *wnd) if(!IsActiveCapturing(m_State)) return true; + RDCLOG("Discarding frame capture."); + SCOPED_LOCK(glLock); RenderDoc::Inst().FinishCaptureWriting(NULL, m_CapturedFrames.back().frameNumber); diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index d2d0cb071..c69e71e57 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -1550,6 +1550,8 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd) if(!IsBackgroundCapturing(m_State)) return; + RDCLOG("Starting capture"); + m_CaptureTimer.Restart(); GetResourceManager()->ResetCaptureStartTime(); @@ -1639,8 +1641,6 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd) GetResourceManager()->MarkMemoryFrameReferenced((*it)->baseResource, (*it)->memOffset, (*it)->memSize, eFrameRef_ReadBeforeWrite); } - - RDCLOG("Starting capture, frame %u", m_CapturedFrames.back().frameNumber); } bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd) @@ -2077,6 +2077,8 @@ bool WrappedVulkan::DiscardFrameCapture(void *dev, void *wnd) if(!IsActiveCapturing(m_State)) return true; + RDCLOG("Discarding frame capture."); + RenderDoc::Inst().FinishCaptureWriting(NULL, m_CapturedFrames.back().frameNumber); m_CapturedFrames.pop_back();