Add support for Tracy on Android

This commit is contained in:
Wojtek Figat
2021-05-13 16:24:35 +02:00
parent 13a6de8645
commit fd3553f668
18 changed files with 12314 additions and 32 deletions

View File

@@ -16,6 +16,11 @@ bool ProfilerGPU::Enabled = true;
int32 ProfilerGPU::CurrentBuffer = 0;
ProfilerGPU::EventBuffer ProfilerGPU::Buffers[PROFILER_GPU_EVENTS_FRAMES];
bool ProfilerGPU::EventBuffer::HasData() const
{
return _isResolved && _data.HasItems();
}
void ProfilerGPU::EventBuffer::EndAll()
{
for (int32 i = 0; i < _data.Count(); i++)
@@ -41,7 +46,7 @@ void ProfilerGPU::EventBuffer::TryResolve()
{
auto& e = _data[i];
e.Time = e.Timer->GetResult();
FreeTimerQuery(e.Timer);
_timerQueriesFree.Add(e.Timer);
e.Timer = nullptr;
}
@@ -55,6 +60,13 @@ int32 ProfilerGPU::EventBuffer::Add(const Event& e)
return index;
}
void ProfilerGPU::EventBuffer::Extract(Array<Event>& data) const
{
// Don't use unresolved data
ASSERT(_isResolved);
data = _data;
}
void ProfilerGPU::EventBuffer::Clear()
{
_data.Clear();