| 319 | } |
| 320 | |
| 321 | void VulkanStatsProvider::begin_sampling(vkb::core::CommandBufferC &cb) |
| 322 | { |
| 323 | uint32_t active_frame_idx = render_context.get_active_frame_index(); |
| 324 | if (timestamp_pool) |
| 325 | { |
| 326 | // We use TimestampQueries when available to provide a more accurate delta_time. |
| 327 | // This counters are from a single command buffer execution, but the passed |
| 328 | // delta time is a frame-to-frame s/w measure. A timestamp query in the the cmd |
| 329 | // buffer gives the actual elapsed time where the counters were measured. |
| 330 | cb.reset_query_pool(*timestamp_pool, active_frame_idx * 2, 1); |
| 331 | cb.write_timestamp(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, *timestamp_pool, |
| 332 | active_frame_idx * 2); |
| 333 | } |
| 334 | |
| 335 | if (query_pool) |
| 336 | { |
| 337 | cb.begin_query(*query_pool, active_frame_idx, static_cast<VkQueryControlFlags>(0)); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | void VulkanStatsProvider::end_sampling(vkb::core::CommandBufferC &cb) |
| 342 | { |
nothing calls this directly
no test coverage detected