mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Replace floating point condition with a bool.
This commit is contained in:
parent
dd05c8f524
commit
7a6141389c
@ -564,9 +564,10 @@ struct GpuCtxData
|
||||
uint64_t count;
|
||||
uint8_t accuracyBits;
|
||||
float period;
|
||||
GpuContextType type;
|
||||
bool hasPeriod;
|
||||
unordered_flat_map<uint64_t, GpuCtxThreadData> threadData;
|
||||
short_ptr<GpuEvent> query[64*1024];
|
||||
GpuContextType type;
|
||||
};
|
||||
|
||||
enum { GpuCtxDataSize = sizeof( GpuCtxData ) };
|
||||
|
@ -892,6 +892,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
|
||||
f.Read4( ctx->thread, ctx->accuracyBits, ctx->count, ctx->period );
|
||||
ctx->type = ctx->thread == 0 ? GpuContextType::Vulkan : GpuContextType::OpenGl;
|
||||
}
|
||||
ctx->hasPeriod = ctx->period != 1.f;
|
||||
m_data.gpuCnt += ctx->count;
|
||||
uint64_t tdsz;
|
||||
f.Read( tdsz );
|
||||
@ -4849,6 +4850,7 @@ void Worker::ProcessGpuNewContext( const QueueGpuNewContext& ev )
|
||||
gpu->period = ev.period;
|
||||
gpu->count = 0;
|
||||
gpu->type = ev.type;
|
||||
gpu->hasPeriod = ev.period != 1.f;
|
||||
m_data.gpuData.push_back( gpu );
|
||||
m_gpuCtxMap[ev.context] = gpu;
|
||||
}
|
||||
@ -4980,7 +4982,7 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev )
|
||||
const int64_t t = std::max<int64_t>( 0, tref );
|
||||
|
||||
int64_t gpuTime;
|
||||
if( ctx->period == 1.f )
|
||||
if( !ctx->hasPeriod )
|
||||
{
|
||||
gpuTime = t;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user