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

Method begin_sampling

framework/stats/vulkan_stats_provider.cpp:321–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void 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
341void VulkanStatsProvider::end_sampling(vkb::core::CommandBufferC &cb)
342{

Callers

nothing calls this directly

Calls 4

reset_query_poolMethod · 0.80
write_timestampMethod · 0.80
begin_queryMethod · 0.80

Tested by

no test coverage detected