mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Don't use capture writer after it is destroyed. Closes #2121
This commit is contained in:
@@ -2080,6 +2080,8 @@ bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd)
|
||||
captureWriter = new StreamWriter(StreamWriter::InvalidStream);
|
||||
}
|
||||
|
||||
uint64_t captureSectionSize = 0;
|
||||
|
||||
{
|
||||
WriteSerialiser ser(captureWriter, Ownership::Stream);
|
||||
|
||||
@@ -2149,11 +2151,12 @@ bool WrappedID3D11Device::EndFrameCapture(void *dev, void *wnd)
|
||||
}
|
||||
|
||||
UnlockForChunkFlushing();
|
||||
|
||||
captureSectionSize = captureWriter->GetOffset();
|
||||
}
|
||||
|
||||
RDCLOG("Captured D3D11 frame with %f MB capture section in %f seconds",
|
||||
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
|
||||
m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
double(captureSectionSize) / (1024.0 * 1024.0), m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
|
||||
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
|
||||
|
||||
|
||||
@@ -2436,6 +2436,8 @@ bool WrappedID3D12Device::EndFrameCapture(void *dev, void *wnd)
|
||||
captureWriter = new StreamWriter(StreamWriter::InvalidStream);
|
||||
}
|
||||
|
||||
uint64_t captureSectionSize = 0;
|
||||
|
||||
{
|
||||
WriteSerialiser ser(captureWriter, Ownership::Stream);
|
||||
|
||||
@@ -2521,11 +2523,12 @@ bool WrappedID3D12Device::EndFrameCapture(void *dev, void *wnd)
|
||||
}
|
||||
|
||||
RDCDEBUG("Done");
|
||||
|
||||
captureSectionSize = captureWriter->GetOffset();
|
||||
}
|
||||
|
||||
RDCLOG("Captured D3D12 frame with %f MB capture section in %f seconds",
|
||||
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
|
||||
m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
double(captureSectionSize) / (1024.0 * 1024.0), m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
|
||||
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
|
||||
|
||||
|
||||
@@ -2299,6 +2299,8 @@ bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd)
|
||||
captureWriter = new StreamWriter(StreamWriter::InvalidStream);
|
||||
}
|
||||
|
||||
uint64_t captureSectionSize = 0;
|
||||
|
||||
{
|
||||
WriteSerialiser ser(captureWriter, Ownership::Stream);
|
||||
|
||||
@@ -2384,11 +2386,12 @@ bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd)
|
||||
|
||||
RDCDEBUG("Done");
|
||||
}
|
||||
|
||||
captureSectionSize = captureWriter->GetOffset();
|
||||
}
|
||||
|
||||
RDCLOG("Captured GL frame with %f MB capture section in %f seconds",
|
||||
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
|
||||
m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
double(captureSectionSize) / (1024.0 * 1024.0), m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
|
||||
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
|
||||
|
||||
|
||||
@@ -1994,6 +1994,8 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd)
|
||||
captureWriter = new StreamWriter(StreamWriter::InvalidStream);
|
||||
}
|
||||
|
||||
uint64_t captureSectionSize = 0;
|
||||
|
||||
{
|
||||
WriteSerialiser ser(captureWriter, Ownership::Stream);
|
||||
|
||||
@@ -2076,11 +2078,12 @@ bool WrappedVulkan::EndFrameCapture(void *dev, void *wnd)
|
||||
|
||||
RDCDEBUG("Done");
|
||||
}
|
||||
|
||||
captureSectionSize = captureWriter->GetOffset();
|
||||
}
|
||||
|
||||
RDCLOG("Captured Vulkan frame with %f MB capture section in %f seconds",
|
||||
double(captureWriter->GetOffset()) / (1024.0 * 1024.0),
|
||||
m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
double(captureSectionSize) / (1024.0 * 1024.0), m_CaptureTimer.GetMilliseconds() / 1000.0);
|
||||
|
||||
RenderDoc::Inst().FinishCaptureWriting(rdc, m_CapturedFrames.back().frameNumber);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user