MCPcopy Create free account
hub / github.com/baldurk/renderdoc / LoadCapture

Method LoadCapture

qrenderdoc/Code/CaptureContext.cpp:827–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827void CaptureContext::LoadCapture(const rdcstr &captureFile, const ReplayOptions &opts,
828 const rdcstr &origFilename, bool temporary, bool local)
829{
830 RENDERDOC_PROFILEFUNCTION();
831
832 CloseCapture();
833
834 PointerTypeRegistry::Init();
835
836 m_LoadInProgress = true;
837
838 if(local)
839 m_Config.CrashReport_LastOpenedCapture = origFilename;
840 else
841 m_Config.CrashReport_LastOpenedCapture = QString();
842
843 m_Config.Save();
844
845 bool newCapture = (!temporary && !Config().RecentCaptureFiles.contains(origFilename));
846
847 LambdaThread *thread =
848 new LambdaThread([this, captureFile, opts, origFilename, temporary, local]() {
849 LoadCaptureThreaded(captureFile, opts, origFilename, temporary, local);
850 });
851 thread->setName(lit("LoadCapture"));
852 thread->selfDelete(true);
853 thread->start();
854
855 QElapsedTimer loadTimer;
856 loadTimer.start();
857
858 ShowProgressDialog(
859 m_MainWindow, tr("Loading Capture: %1").arg(QFileInfo(origFilename).fileName()),
860 [this]() { return !m_LoadInProgress; }, [this]() { return UpdateLoadProgress(); });
861
862 if(local)
863 {
864 m_Watcher = new QFileSystemWatcher({captureFile}, GetMainWindow()->Widget());
865
866 QObject::connect(m_Watcher, &QFileSystemWatcher::fileChanged, [this]() {
867 Replay().AsyncInvoke([this](IReplayController *r) {
868 r->FileChanged();
869 r->SetFrameEvent(m_EventID, true);
870 GUIInvoke::call(GetMainWindow()->Widget(), [this]() { RefreshUIStatus({}, true, true); });
871 });
872 });
873 }
874
875#if defined(RELEASE)
876 ANALYTIC_ADDAVG(Performance.LoadTime, double(loadTimer.nsecsElapsed() * 1.0e-9));
877#endif
878
879 if(m_APIProps.ShaderLinkage)
880 ANALYTIC_SET(CaptureFeatures.ShaderLinkage, true);
881 if(m_APIProps.YUVTextures)
882 ANALYTIC_SET(CaptureFeatures.YUVTextures, true);
883 if(m_APIProps.SparseResources)
884 ANALYTIC_SET(CaptureFeatures.SparseResources, true);

Callers

nothing calls this directly

Calls 15

ShowProgressDialogFunction · 0.85
connectFunction · 0.85
selfDeleteMethod · 0.80
fileNameMethod · 0.80
setProgressMethod · 0.80
trFunction · 0.70
ToQStrFunction · 0.70
InitFunction · 0.50
QStringFunction · 0.50
ConfigClass · 0.50
QFileInfoClass · 0.50
SaveMethod · 0.45

Tested by

no test coverage detected