Save/load GPU timer overflow information.

This commit is contained in:
Bartosz Taudul 2021-06-09 21:12:50 +02:00
parent 9e28f441c8
commit ff54c29913
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1003,17 +1003,25 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
for( uint64_t i=0; i<sz; i++ ) for( uint64_t i=0; i<sz; i++ )
{ {
auto ctx = m_slab.AllocInit<GpuCtxData>(); auto ctx = m_slab.AllocInit<GpuCtxData>();
if( fileVer >= FileVersion( 0, 7, 6 ) ) if( fileVer >= FileVersion( 0, 7, 9 ) )
{
uint8_t calibration;
f.Read7( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name, ctx->overflow );
ctx->hasCalibration = calibration;
}
else if( fileVer >= FileVersion( 0, 7, 6 ) )
{ {
uint8_t calibration; uint8_t calibration;
f.Read6( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name ); f.Read6( ctx->thread, calibration, ctx->count, ctx->period, ctx->type, ctx->name );
ctx->hasCalibration = calibration; ctx->hasCalibration = calibration;
ctx->overflow = 0;
} }
else if( fileVer >= FileVersion( 0, 7, 1 ) ) else if( fileVer >= FileVersion( 0, 7, 1 ) )
{ {
uint8_t calibration; uint8_t calibration;
f.Read5( ctx->thread, calibration, ctx->count, ctx->period, ctx->type ); f.Read5( ctx->thread, calibration, ctx->count, ctx->period, ctx->type );
ctx->hasCalibration = calibration; ctx->hasCalibration = calibration;
ctx->overflow = 0;
} }
else else
{ {
@ -1028,8 +1036,8 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
ctx->type = ctx->thread == 0 ? GpuContextType::Vulkan : GpuContextType::OpenGl; ctx->type = ctx->thread == 0 ? GpuContextType::Vulkan : GpuContextType::OpenGl;
} }
ctx->hasCalibration = false; ctx->hasCalibration = false;
ctx->overflow = 0;
} }
ctx->overflow = 0;
ctx->hasPeriod = ctx->period != 1.f; ctx->hasPeriod = ctx->period != 1.f;
m_data.gpuCnt += ctx->count; m_data.gpuCnt += ctx->count;
uint64_t tdsz; uint64_t tdsz;
@ -7339,6 +7347,7 @@ void Worker::Write( FileWrite& f, bool fiDict )
f.Write( &ctx->period, sizeof( ctx->period ) ); f.Write( &ctx->period, sizeof( ctx->period ) );
f.Write( &ctx->type, sizeof( ctx->type ) ); f.Write( &ctx->type, sizeof( ctx->type ) );
f.Write( &ctx->name, sizeof( ctx->name ) ); f.Write( &ctx->name, sizeof( ctx->name ) );
f.Write( &ctx->overflow, sizeof( ctx->overflow ) );
sz = ctx->threadData.size(); sz = ctx->threadData.size();
f.Write( &sz, sizeof( sz ) ); f.Write( &sz, sizeof( sz ) );
for( auto& td : ctx->threadData ) for( auto& td : ctx->threadData )