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

Method ReadLogInitialisation

renderdoc/driver/gl/gl_driver.cpp:3469–3641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3467}
3468
3469RDResult WrappedOpenGL::ReadLogInitialisation(RDCFile *rdc, bool storeStructuredBuffers)
3470{
3471 int sectionIdx = rdc->SectionIndex(SectionType::FrameCapture);
3472
3473 if(sectionIdx < 0)
3474 RETURN_ERROR_RESULT(ResultCode::FileCorrupted, "File does not contain captured API data");
3475
3476 StreamReader *reader = rdc->ReadSection(sectionIdx);
3477
3478 if(IsStructuredExporting(m_State))
3479 {
3480 // when structured exporting don't do any timebase conversion
3481 m_TimeBase = 0;
3482 m_TimeFrequency = 1.0;
3483 }
3484 else
3485 {
3486 m_TimeBase = rdc->GetTimestampBase();
3487 m_TimeFrequency = rdc->GetTimestampFrequency();
3488 }
3489
3490 if(reader->IsErrored())
3491 {
3492 RDResult result = reader->GetError();
3493 delete reader;
3494 return result;
3495 }
3496
3497 ReadSerialiser ser(reader, Ownership::Stream);
3498
3499 ser.SetStringDatabase(&m_StringDB);
3500 ser.SetUserData(GetResourceManager());
3501
3502 ser.ConfigureStructuredExport(&GetChunkName, storeStructuredBuffers, m_TimeBase, m_TimeFrequency);
3503
3504 m_StructuredFile = &ser.GetStructuredFile();
3505
3506 m_StoredStructuredData->version = m_StructuredFile->version = m_SectionVersion;
3507
3508 ser.SetVersion(m_SectionVersion);
3509
3510 int chunkIdx = 0;
3511
3512 struct chunkinfo
3513 {
3514 chunkinfo() : count(0), totalsize(0), total(0.0) {}
3515 int count;
3516 uint64_t totalsize;
3517 double total;
3518 };
3519
3520 std::map<GLChunk, chunkinfo> chunkInfos;
3521
3522 SCOPED_TIMER("chunk initialisation");
3523
3524 uint64_t frameDataSize = 0;
3525
3526 for(;;)

Callers

nothing calls this directly

Calls 15

IsStructuredExportingFunction · 0.85
RDResultClass · 0.85
FmtFunction · 0.85
SectionIndexMethod · 0.80
ReadSectionMethod · 0.80
GetTimestampBaseMethod · 0.80
SetStringDatabaseMethod · 0.80
SetVersionMethod · 0.80
EndChunkMethod · 0.80
SetProgressMethod · 0.80
GetMillisecondsMethod · 0.80

Tested by

no test coverage detected