mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Properly save compressed thread in GPU events.
This commit is contained in:
parent
1856d057c1
commit
2a618c90d5
@ -131,9 +131,9 @@ struct GpuEvent
|
||||
int64_t gpuStart;
|
||||
int64_t gpuEnd;
|
||||
int32_t srcloc;
|
||||
uint16_t thread;
|
||||
// All above is read/saved as-is.
|
||||
|
||||
// This must be last. All above is read/saved as-is.
|
||||
uint16_t thread;
|
||||
Vector<GpuEvent*> child;
|
||||
};
|
||||
|
||||
|
@ -2368,7 +2368,10 @@ void Worker::ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec, uint64_t size )
|
||||
auto zone = m_slab.AllocInit<GpuEvent>();
|
||||
vec.push_back_no_space_check( zone );
|
||||
|
||||
f.Read( zone, sizeof( GpuEvent ) - sizeof( GpuEvent::child ) );
|
||||
f.Read( zone, sizeof( GpuEvent::cpuStart ) + sizeof( GpuEvent::cpuEnd ) + sizeof( GpuEvent::gpuStart ) + sizeof( GpuEvent::gpuEnd ) + sizeof( GpuEvent::srcloc ) );
|
||||
uint64_t thread;
|
||||
f.Read( thread );
|
||||
zone->thread = CompressThread( thread );
|
||||
ReadTimeline( f, zone->child );
|
||||
}
|
||||
}
|
||||
@ -2581,7 +2584,9 @@ void Worker::WriteTimeline( FileWrite& f, const Vector<GpuEvent*>& vec )
|
||||
|
||||
for( auto& v : vec )
|
||||
{
|
||||
f.Write( v, sizeof( GpuEvent ) - sizeof( GpuEvent::child ) );
|
||||
f.Write( v, sizeof( GpuEvent::cpuStart ) + sizeof( GpuEvent::cpuEnd ) + sizeof( GpuEvent::gpuStart ) + sizeof( GpuEvent::gpuEnd ) + sizeof( GpuEvent::srcloc ) );
|
||||
uint64_t thread = DecompressThread( v->thread );
|
||||
f.Write( &thread, sizeof( thread ) );
|
||||
WriteTimeline( f, v->child );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user