1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Count GPU zones.

This commit is contained in:
Bartosz Taudul 2019-10-13 14:13:04 +02:00
parent c3870f8837
commit 5e1894dd79
2 changed files with 10 additions and 9 deletions

View File

@ -3978,6 +3978,8 @@ void Worker::ProcessGpuNewContext( const QueueGpuNewContext& ev )
void Worker::ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev ) void Worker::ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev )
{ {
m_data.gpuCnt++;
auto ctx = m_gpuCtxMap[ev.context]; auto ctx = m_gpuCtxMap[ev.context];
assert( ctx ); assert( ctx );
@ -4906,6 +4908,7 @@ void Worker::ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec, uint64_t size, i
{ {
assert( size != 0 ); assert( size != 0 );
vec.reserve_exact( size, m_slab ); vec.reserve_exact( size, m_slab );
m_data.gpuCnt += size;
auto zone = (GpuEvent*)m_slab.AllocBig( sizeof( GpuEvent ) * size ); auto zone = (GpuEvent*)m_slab.AllocBig( sizeof( GpuEvent ) * size );
auto zptr = zone; auto zptr = zone;
auto vptr = vec.data(); auto vptr = vec.data();
@ -4939,6 +4942,7 @@ void Worker::ReadTimelinePre059( FileRead& f, Vector<GpuEvent*>& vec, uint64_t s
{ {
assert( size != 0 ); assert( size != 0 );
vec.reserve_exact( size, m_slab ); vec.reserve_exact( size, m_slab );
m_data.gpuCnt += size;
for( uint64_t i=0; i<size; i++ ) for( uint64_t i=0; i<size; i++ )
{ {

View File

@ -154,11 +154,7 @@ private:
struct DataBlock struct DataBlock
{ {
DataBlock() DataBlock()
: zonesCnt( 0 ) : threadDataLast( std::numeric_limits<uint64_t>::max(), nullptr )
, baseTime( 0 )
, lastTime( 0 )
, frameOffset( 0 )
, threadDataLast( std::numeric_limits<uint64_t>::max(), nullptr )
, ctxSwitchLast( std::numeric_limits<uint64_t>::max(), nullptr ) , ctxSwitchLast( std::numeric_limits<uint64_t>::max(), nullptr )
{} {}
@ -170,10 +166,11 @@ private:
StringDiscovery<PlotData*> plots; StringDiscovery<PlotData*> plots;
Vector<ThreadData*> threads; Vector<ThreadData*> threads;
MemData memory; MemData memory;
uint64_t zonesCnt; uint64_t zonesCnt = 0;
int64_t baseTime; uint64_t gpuCnt = 0;
int64_t lastTime; int64_t baseTime = 0;
uint64_t frameOffset; int64_t lastTime = 0;
uint64_t frameOffset = 0;
flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings; flat_hash_map<uint64_t, const char*, nohash<uint64_t>> strings;
Vector<const char*> stringData; Vector<const char*> stringData;