From efac062cddbed448d16b807323dd485d975800d5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 3 Dec 2014 23:24:40 +0000 Subject: [PATCH] Make sure to apply initial contents before first replay of frame --- renderdoc/driver/gl/gl_driver.cpp | 33 ++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 019e2fba6..f8325cee1 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -1624,8 +1624,9 @@ void WrappedOpenGL::ReadLogInitialisation() struct chunkinfo { - chunkinfo() : count(0), total(0.0) {} + chunkinfo() : count(0), totalsize(0), total(0.0) {} int count; + uint64_t totalsize; double total; }; @@ -1651,26 +1652,40 @@ void WrappedOpenGL::ReadLogInitialisation() if(context == CAPTURE_SCOPE) { - ContextReplayLog(READING, 0, 0, false); + GetResourceManager()->ApplyInitialContents(); + ContextReplayLog(READING, 0, 0, false); + } + + uint64_t offset2 = m_pSerialiser->GetOffset(); + + chunkInfos[context].total += timer.GetMilliseconds(); + chunkInfos[context].totalsize += offset2 - offset; + chunkInfos[context].count++; + + if(context == CAPTURE_SCOPE) + { if(m_pSerialiser->GetOffset() > lastFrame) break; } - chunkInfos[context].total += timer.GetMilliseconds(); - chunkInfos[context].count++; - if(m_pSerialiser->AtEnd()) { break; } } - + for(auto it=chunkInfos.begin(); it != chunkInfos.end(); ++it) { - RDCDEBUG("%s: %.3f total time in %d chunks - %.3f average", - GetChunkName(it->first), it->second.total, it->second.count, - it->second.total/double(it->second.count)); + double dcount = double(it->second.count); + + RDCDEBUG("% 5d chunks - Time: %9.3fms total/%9.3fms avg - Size: %8.3fMB total/%7.3fMB avg - %s (%u)", + it->second.count, + it->second.total, it->second.total/dcount, + double(it->second.totalsize)/(1024.0*1024.0), + double(it->second.totalsize)/(dcount*1024.0*1024.0), + GetChunkName(it->first), uint32_t(it->first) + ); } RDCDEBUG("Allocating %llu persistant bytes of memory for the log.", m_pSerialiser->GetSize() - firstFrame);