1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 14:03:52 +00:00

Disallow negative GPU times.

Shouldn't happen, but GPU timestamps are a shitshow, so better be safe
than sorry.
This commit is contained in:
Bartosz Taudul 2019-10-30 22:37:07 +01:00
parent 0ac432dd25
commit 7ce8c772ad

View File

@ -4297,8 +4297,9 @@ void Worker::ProcessGpuTime( const QueueGpuTime& ev )
auto ctx = m_gpuCtxMap[ev.context]; auto ctx = m_gpuCtxMap[ev.context];
assert( ctx ); assert( ctx );
const int64_t t = m_refTimeGpu + ev.gpuTime; const int64_t tref = m_refTimeGpu + ev.gpuTime;
m_refTimeGpu = t; m_refTimeGpu = tref;
const int64_t t = std::max<int64_t>( 0, tref );
int64_t gpuTime; int64_t gpuTime;
if( ctx->period == 1.f ) if( ctx->period == 1.f )