MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / end_sampling

Method end_sampling

framework/stats/vulkan_stats_provider.cpp:341–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void 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
367static double get_counter_value(const VkPerformanceCounterResultKHR &result,
368 VkPerformanceCounterStorageKHR storage)

Callers

nothing calls this directly

Calls 5

end_queryMethod · 0.80
reset_query_poolMethod · 0.80
write_timestampMethod · 0.80
get_handleMethod · 0.45

Tested by

no test coverage detected