| 288 | } |
| 289 | |
| 290 | void GraphicsDumping::OnDraw() |
| 291 | { |
| 292 | PROFILE_MEM(Profiler); |
| 293 | |
| 294 | // Process only frames in the profiling range that have data |
| 295 | for (auto& frame : ProfilerGPU::Buffers) |
| 296 | { |
| 297 | if (frame.FrameIndex == NextFrame && frame.HasData()) |
| 298 | { |
| 299 | // Extract events from the frame |
| 300 | FrameData.Clear(); |
| 301 | frame.Extract(FrameData); |
| 302 | |
| 303 | // Put events into the current items hierarchy |
| 304 | Add(FrameData); |
| 305 | |
| 306 | // Move to the next frame |
| 307 | NextFrame++; |
| 308 | FramesLeft--; |
| 309 | if (FramesLeft == 0) |
| 310 | { |
| 311 | // Done! |
| 312 | Print(); |
| 313 | Delete(Dumping); |
| 314 | Dumping = nullptr; |
| 315 | return; |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | void GraphicsDumping::Add(Array<ProfilerGPU::Event>& events) |
| 322 | { |