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];
assert( ctx );
const int64_t t = m_refTimeGpu + ev.gpuTime;
m_refTimeGpu = t;
const int64_t tref = m_refTimeGpu + ev.gpuTime;
m_refTimeGpu = tref;
const int64_t t = std::max<int64_t>( 0, tref );
int64_t gpuTime;
if( ctx->period == 1.f )