mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Proper way to get full frame count.
This commit is contained in:
parent
faea036c16
commit
9f4d6692dc
@ -6354,7 +6354,7 @@ void View::DrawInfo()
|
||||
TextFocused( "Call stacks:", RealToString( m_worker.GetCallstackPayloadCount(), true ) );
|
||||
TextFocused( "Call stack frames:", RealToString( m_worker.GetCallstackFrameCount(), true ) );
|
||||
|
||||
const auto fsz = m_worker.GetFrameCount( *m_frames ) - 1;
|
||||
const auto fsz = m_worker.GetFullFrameCount( *m_frames );
|
||||
if( fsz != 0 )
|
||||
{
|
||||
if( m_frameSortData.frameSet != m_frames || m_frameSortData.frameNum != fsz )
|
||||
|
@ -953,6 +953,36 @@ uint64_t Worker::GetPlotCount() const
|
||||
return cnt;
|
||||
}
|
||||
|
||||
size_t Worker::GetFullFrameCount( const FrameData& fd ) const
|
||||
{
|
||||
const auto sz = fd.frames.size();
|
||||
assert( sz != 0 );
|
||||
|
||||
if( fd.continuous )
|
||||
{
|
||||
if( IsConnected() )
|
||||
{
|
||||
return sz - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return sz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& last = fd.frames.back();
|
||||
if( last.end >= 0 )
|
||||
{
|
||||
return sz;
|
||||
}
|
||||
else
|
||||
{
|
||||
return sz - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Worker::GetFrameTime( const FrameData& fd, size_t idx ) const
|
||||
{
|
||||
if( fd.continuous )
|
||||
|
@ -185,6 +185,7 @@ public:
|
||||
|
||||
TracyMutex& GetDataLock() { return m_data.lock; }
|
||||
size_t GetFrameCount( const FrameData& fd ) const { return fd.frames.size(); }
|
||||
size_t GetFullFrameCount( const FrameData& fd ) const;
|
||||
int64_t GetTimeBegin() const { return GetFrameBegin( *m_data.framesBase, 0 ); }
|
||||
int64_t GetLastTime() const { return m_data.lastTime; }
|
||||
uint64_t GetZoneCount() const { return m_data.zonesCnt; }
|
||||
|
Loading…
Reference in New Issue
Block a user