| 339 | } |
| 340 | |
| 341 | void VulkanStatsProvider::end_sampling(vkb::core::CommandBufferC &cb) |
| 342 | { |
| 343 | uint32_t active_frame_idx = render_context.get_active_frame_index(); |
| 344 | |
| 345 | if (query_pool) |
| 346 | { |
| 347 | // Perform a barrier to ensure all previous commands complete before ending the query |
| 348 | // This does not block later commands from executing as we use BOTTOM_OF_PIPE in the |
| 349 | // dst stage mask |
| 350 | vkCmdPipelineBarrier(cb.get_handle(), |
| 351 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, |
| 352 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, |
| 353 | 0, 0, nullptr, 0, nullptr, 0, nullptr); |
| 354 | cb.end_query(*query_pool, active_frame_idx); |
| 355 | |
| 356 | ++queries_ready; |
| 357 | } |
| 358 | |
| 359 | if (timestamp_pool) |
| 360 | { |
| 361 | cb.reset_query_pool(*timestamp_pool, active_frame_idx * 2 + 1, 1); |
| 362 | cb.write_timestamp(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, *timestamp_pool, |
| 363 | active_frame_idx * 2 + 1); |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | static double get_counter_value(const VkPerformanceCounterResultKHR &result, |
| 368 | VkPerformanceCounterStorageKHR storage) |
nothing calls this directly
no test coverage detected