1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Send time deltas in GPU time events.

This commit is contained in:
Bartosz Taudul
2019-10-25 19:52:01 +02:00
parent 1ce25d3aef
commit 0f2503d334
6 changed files with 27 additions and 5 deletions
+5 -2
View File
@@ -4188,14 +4188,17 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev )
auto ctx = m_gpuCtxMap[ev.context];
assert( ctx );
const int64_t t = m_refTimeGpu + ev.gpuTime;
m_refTimeGpu = t;
int64_t gpuTime;
if( ctx->period == 1.f )
{
gpuTime = ev.gpuTime;
gpuTime = t;
}
else
{
gpuTime = int64_t( double( ctx->period ) * ev.gpuTime ); // precision loss
gpuTime = int64_t( double( ctx->period ) * t ); // precision loss
}
auto zone = ctx->query[ev.queryId];