mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-17 13:07:14 +00:00
Add a debug option to embed the log file in captures
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "api/replay/version.h"
|
||||
#include "common/common.h"
|
||||
#include "common/threading.h"
|
||||
#include "core/settings.h"
|
||||
#include "hooks/hooks.h"
|
||||
#include "maths/formatpacking.h"
|
||||
#include "replay/replay_driver.h"
|
||||
@@ -44,6 +45,9 @@
|
||||
|
||||
#include "replay/renderdoc_serialise.inl"
|
||||
|
||||
RDOC_DEBUG_CONFIG(bool, Capture_Debug_SnapshotDiagnosticLog, false,
|
||||
"Snapshot the diagnostic log at capture time and embed in the capture.");
|
||||
|
||||
void LogReplayOptions(const ReplayOptions &opts)
|
||||
{
|
||||
RDCLOG("%s API validation during replay", (opts.apiValidation ? "Enabling" : "Not enabling"));
|
||||
@@ -1681,6 +1685,22 @@ void RenderDoc::FinishCaptureWriting(RDCFile *rdc, uint32_t frameNumber)
|
||||
delete w;
|
||||
}
|
||||
|
||||
if(Capture_Debug_SnapshotDiagnosticLog())
|
||||
{
|
||||
rdcstr logcontents = FileIO::logfile_readall(RDCGETLOGFILE());
|
||||
|
||||
SectionProperties props = {};
|
||||
props.type = SectionType::EmbeddedLogfile;
|
||||
props.version = 1;
|
||||
StreamWriter *w = rdc->WriteSection(props);
|
||||
|
||||
w->Write(logcontents.data(), logcontents.size());
|
||||
|
||||
w->Finish();
|
||||
|
||||
delete w;
|
||||
}
|
||||
|
||||
RDCLOG("Written to disk: %s", m_CurrentLogFile.c_str());
|
||||
|
||||
CaptureData cap(m_CurrentLogFile, Timing::GetUnixTimestamp(), rdc->GetDriver(), frameNumber);
|
||||
|
||||
Reference in New Issue
Block a user