mirror of
https://github.com/wolfpld/tracy
synced 2025-05-07 15:33:52 +00:00
Manual initialization of GpuEvents.
This commit is contained in:
parent
54c5cfce66
commit
a3ba188af5
@ -108,6 +108,8 @@ static_assert( std::numeric_limits<decltype(LockEvent::lockCount)>::max() >= Max
|
|||||||
|
|
||||||
struct GpuEvent
|
struct GpuEvent
|
||||||
{
|
{
|
||||||
|
void Init() { memset( &child, 0, 12 ); }
|
||||||
|
|
||||||
int64_t cpuStart;
|
int64_t cpuStart;
|
||||||
int64_t cpuEnd;
|
int64_t cpuEnd;
|
||||||
int64_t gpuStart;
|
int64_t gpuStart;
|
||||||
@ -118,6 +120,7 @@ struct GpuEvent
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum { GpuEventSize = sizeof( GpuEvent ) };
|
enum { GpuEventSize = sizeof( GpuEvent ) };
|
||||||
|
static_assert( sizeof( GpuEvent::child ) == 13, "Adjust vector clear size!" );
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
|
@ -855,7 +855,9 @@ void View::ProcessGpuZoneBegin( const QueueGpuZoneBegin& ev )
|
|||||||
|
|
||||||
CheckSourceLocation( ev.srcloc );
|
CheckSourceLocation( ev.srcloc );
|
||||||
|
|
||||||
auto zone = m_slab.AllocInit<GpuEvent>();
|
auto zone = m_slab.Alloc<GpuEvent>();
|
||||||
|
zone->Init();
|
||||||
|
|
||||||
zone->cpuStart = ev.cpuTime * m_timerMul;
|
zone->cpuStart = ev.cpuTime * m_timerMul;
|
||||||
zone->cpuEnd = -1;
|
zone->cpuEnd = -1;
|
||||||
zone->gpuStart = std::numeric_limits<int64_t>::max();
|
zone->gpuStart = std::numeric_limits<int64_t>::max();
|
||||||
@ -3871,7 +3873,9 @@ void View::ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec )
|
|||||||
|
|
||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
auto zone = m_slab.AllocInit<GpuEvent>();
|
auto zone = m_slab.Alloc<GpuEvent>();
|
||||||
|
zone->Init();
|
||||||
|
|
||||||
vec.push_back( zone );
|
vec.push_back( zone );
|
||||||
|
|
||||||
f.Read( &zone->cpuStart, sizeof( zone->cpuStart ) );
|
f.Read( &zone->cpuStart, sizeof( zone->cpuStart ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user