MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / BeginEvent

Method BeginEvent

Source/Engine/Profiler/ProfilerGPU.cpp:95–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95int32 ProfilerGPU::BeginEvent(const Char* name)
96{
97 auto context = GPUDevice::Instance->GetMainContext();
98#if GPU_ALLOW_PROFILE_EVENTS
99 if (EventsEnabled)
100 context->EventBegin(name);
101#endif
102 if (!Enabled)
103 return -1;
104
105 Event e;
106 e.Name = name;
107 e.Stats = RenderStatsData::Counter;
108 e.Query = context->BeginQuery(GPUQueryType::Timer);
109 e.Depth = _depth++;
110 e.QueryActive = true;
111
112 auto& buffer = Buffers[CurrentBuffer];
113 const auto index = buffer.Add(e);
114 return index;
115}
116
117void ProfilerGPU::EndEvent(int32 index)
118{

Callers

nothing calls this directly

Calls 4

GetMainContextMethod · 0.45
EventBeginMethod · 0.45
BeginQueryMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected