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

Method OpenCapture

renderdoc/replay/capture_file.cpp:357–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357rdcpair<ResultDetails, IReplayController *> CaptureFile::OpenCapture(const ReplayOptions &opts,
358 RENDERDOC_ProgressCallback progress)
359{
360 ResultDetails ret;
361 ReplayController *render = NULL;
362
363 if(!m_RDC)
364 return {RDResult(ResultCode::InternalError, "RDC file unexpectedly NULL"), render};
365
366 ret = m_RDC->Error();
367
368 if(!ret.OK())
369 return {ret, render};
370
371 render = new ReplayController();
372
373 LogReplayOptions(opts);
374
375 RenderDoc::Inst().SetProgressCallback<LoadProgress>(progress);
376
377 // This has to be before the device is created for the capture
378 RenderDoc::Inst().ClearTrackedFiles();
379 // This section is optional any errors do not block opening the capture
380 if(m_RDC->SectionIndex(SectionType::EmbeddedExternalFiles) >= 0)
381 ret = RenderDoc::Inst().ReadExternalFiles(m_RDC);
382
383 ret = render->CreateDevice(m_RDC, opts);
384
385 RenderDoc::Inst().SetProgressCallback<LoadProgress>(RENDERDOC_ProgressCallback());
386
387 if(!ret.OK())
388 {
389 render->Shutdown();
390 render = NULL;
391 }
392
393 return {ret, render};
394}
395
396void CaptureFile::SetMetadata(const rdcstr &driverName, uint64_t machineIdent, FileType thumbType,
397 uint32_t thumbWidth, uint32_t thumbHeight, const bytebuf &thumbData,

Callers

nothing calls this directly

Calls 8

RDResultClass · 0.85
LogReplayOptionsFunction · 0.85
ClearTrackedFilesMethod · 0.80
SectionIndexMethod · 0.80
ReadExternalFilesMethod · 0.80
ErrorMethod · 0.45
CreateDeviceMethod · 0.45
ShutdownMethod · 0.45

Tested by

no test coverage detected