| 289 | } |
| 290 | |
| 291 | void OnDrawFrame() override |
| 292 | { |
| 293 | UpdateScene(); |
| 294 | |
| 295 | commands->Begin(); |
| 296 | { |
| 297 | // Measure GPU performance |
| 298 | commands->BeginQuery(*timerQuery); |
| 299 | { |
| 300 | // Set buffers |
| 301 | commands->SetVertexBuffer(*vertexBuffer); |
| 302 | |
| 303 | // Start with geometry query |
| 304 | commands->BeginQuery(*geometryQuery); |
| 305 | { |
| 306 | commands->SetViewport(swapChain->GetResolution()); |
| 307 | |
| 308 | commands->BeginRenderPass(*swapChain); |
| 309 | { |
| 310 | RenderBoundingBoxes(); |
| 311 | RenderScene(); |
| 312 | } |
| 313 | commands->EndRenderPass(); |
| 314 | } |
| 315 | commands->EndQuery(*geometryQuery); |
| 316 | } |
| 317 | commands->EndQuery(*timerQuery); |
| 318 | } |
| 319 | commands->End(); |
| 320 | commandQueue->Submit(*commands); |
| 321 | |
| 322 | // Print query results every couple of milliseconds |
| 323 | auto currentTime = Clock::now(); |
| 324 | if (std::chrono::duration_cast<Ticks>(currentTime - prevPrintTime).count() >= printRefreshRate) |
| 325 | { |
| 326 | prevPrintTime = currentTime; |
| 327 | PrintQueryResults(); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | }; |
| 332 |
nothing calls this directly
no test coverage detected