mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 06:03:51 +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;
|
uint64_t count;
|
||||||
uint8_t accuracyBits;
|
uint8_t accuracyBits;
|
||||||
float period;
|
float period;
|
||||||
|
GpuContextType type;
|
||||||
|
bool hasPeriod;
|
||||||
unordered_flat_map<uint64_t, GpuCtxThreadData> threadData;
|
unordered_flat_map<uint64_t, GpuCtxThreadData> threadData;
|
||||||
short_ptr<GpuEvent> query[64*1024];
|
short_ptr<GpuEvent> query[64*1024];
|
||||||
GpuContextType type;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { GpuCtxDataSize = sizeof( GpuCtxData ) };
|
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 );
|
f.Read4( ctx->thread, ctx->accuracyBits, ctx->count, ctx->period );
|
||||||
ctx->type = ctx->thread == 0 ? GpuContextType::Vulkan : GpuContextType::OpenGl;
|
ctx->type = ctx->thread == 0 ? GpuContextType::Vulkan : GpuContextType::OpenGl;
|
||||||
}
|
}
|
||||||
|
ctx->hasPeriod = ctx->period != 1.f;
|
||||||
m_data.gpuCnt += ctx->count;
|
m_data.gpuCnt += ctx->count;
|
||||||
uint64_t tdsz;
|
uint64_t tdsz;
|
||||||
f.Read( tdsz );
|
f.Read( tdsz );
|
||||||
@ -4849,6 +4850,7 @@ void Worker::ProcessGpuNewContext( const QueueGpuNewContext& ev )
|
|||||||
gpu->period = ev.period;
|
gpu->period = ev.period;
|
||||||
gpu->count = 0;
|
gpu->count = 0;
|
||||||
gpu->type = ev.type;
|
gpu->type = ev.type;
|
||||||
|
gpu->hasPeriod = ev.period != 1.f;
|
||||||
m_data.gpuData.push_back( gpu );
|
m_data.gpuData.push_back( gpu );
|
||||||
m_gpuCtxMap[ev.context] = 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 );
|
const int64_t t = std::max<int64_t>( 0, tref );
|
||||||
|
|
||||||
int64_t gpuTime;
|
int64_t gpuTime;
|
||||||
if( ctx->period == 1.f )
|
if( !ctx->hasPeriod )
|
||||||
{
|
{
|
||||||
gpuTime = t;
|
gpuTime = t;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user