Fix nested profiler events usage
#https://github.com/FlaxEngine/FlaxEngine/issues/1380
This commit is contained in:
@@ -129,8 +129,15 @@ void ProfilerCPU::Thread::EndEvent()
|
||||
{
|
||||
const double time = Platform::GetTimeSeconds() * 1000.0;
|
||||
_depth--;
|
||||
Event& e = (Buffer.Last()--).Event();
|
||||
e.End = time;
|
||||
for (auto i = Buffer.Last(); i != Buffer.Begin(); --i)
|
||||
{
|
||||
Event& e = i.Event();
|
||||
if (e.End <= 0)
|
||||
{
|
||||
e.End = time;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ProfilerCPU::IsProfilingCurrentThread()
|
||||
|
||||
Reference in New Issue
Block a user