| 3467 | } |
| 3468 | |
| 3469 | RDResult 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(;;) |
nothing calls this directly
no test coverage detected