| 866 | } |
| 867 | |
| 868 | static void ProcessSample(dmProfileRender::ProfilerThread* thread, int indent, dmProfiler::HSample sample) |
| 869 | { |
| 870 | dmProfileRender::ProfilerSample out; |
| 871 | |
| 872 | out.m_StartTime = dmProfiler::SampleGetStart(sample); |
| 873 | out.m_Time = dmProfiler::SampleGetTime(sample); |
| 874 | out.m_SelfTime = dmProfiler::SampleGetSelfTime(sample); |
| 875 | out.m_Count = dmProfiler::SampleGetCallCount(sample); |
| 876 | out.m_Color = dmProfiler::SampleGetColor(sample); |
| 877 | out.m_Indent = (uint8_t)indent; |
| 878 | const char* name = dmProfiler::SampleGetName(sample); |
| 879 | out.m_NameHash = dmHashString32(name?name:"<empty_sample_name>"); |
| 880 | if (!out.m_Color) |
| 881 | out.m_Color = MakeColorFromHash(out.m_NameHash); |
| 882 | |
| 883 | if (thread->m_Samples.Full()) |
| 884 | thread->m_Samples.OffsetCapacity(32); |
| 885 | thread->m_Samples.Push(out); |
| 886 | } |
| 887 | |
| 888 | static void TraverseSampleTree(dmProfileRender::ProfilerThread* thread, int indent, dmProfiler::HSample sample) |
| 889 | { |
no test coverage detected