| 886 | } |
| 887 | |
| 888 | ProfilerThread* FindOrCreateProfilerThread(ProfilerFrame* ctx, uint32_t name_hash) |
| 889 | { |
| 890 | ProfilerThread* thread = FindProfilerThread(ctx, name_hash); |
| 891 | if (thread != 0) |
| 892 | return thread; |
| 893 | |
| 894 | thread = new ProfilerThread; |
| 895 | thread->m_NameHash = name_hash; |
| 896 | thread->m_Samples.SetCapacity(1); //TODO: Increase!! |
| 897 | |
| 898 | if (ctx->m_Threads.Full()) |
| 899 | ctx->m_Threads.OffsetCapacity(8); |
| 900 | ctx->m_Threads.Push(thread); |
| 901 | return thread; |
| 902 | } |
| 903 | |
| 904 | void ClearProfilerThreadSamples(ProfilerThread* thread) |
| 905 | { |