MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / frameBegin

Function frameBegin

TheForceEngine/TFE_System/profiler.cpp:177–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 }
176
177 void frameBegin()
178 {
179 std::swap(s_readBuffer, s_writeBuffer);
180 // Validate buffer indices.
181 assert(s_readBuffer < ZONE_BUFFER_COUNT && s_writeBuffer < ZONE_BUFFER_COUNT && s_readBuffer != s_writeBuffer);
182 s_readBuffer %= ZONE_BUFFER_COUNT;
183 s_writeBuffer %= ZONE_BUFFER_COUNT;
184
185 s_level = 0;
186 s_maxLevel = 0;
187 s_roots.clear();
188
189 // Swap buffers, s_readBuffer is safe to read in the middle of the next frame.
190 const size_t zoneCount = s_zoneList.size();
191 for (size_t i = 0; i < zoneCount; i++)
192 {
193 s_zoneList[i].timeInZone[s_writeBuffer] = 0;
194 }
195
196 // Copy counter values from the frame, so that the results can be used
197 // in the middle of the next frame.
198 const size_t counterCount = s_counterList.size();
199 for (size_t i = 0; i < counterCount; i++)
200 {
201 s_counterList[i].prevValue = *s_counterList[i].ptr;
202 }
203
204 s_frameBegin = TFE_System::getCurrentTimeInTicks();
205 }
206
207 void traverseZoneTree(u32 id)
208 {

Callers

nothing calls this directly

Calls 4

getCurrentTimeInTicksFunction · 0.85
swapFunction · 0.50
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected