SpiecsEngine
 
Loading...
Searching...
No Matches
RenderPassStatistics.cpp
Go to the documentation of this file.
1/**
2* @file RenderPassStatistics.cpp
3* @brief The RenderPassStatistics Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
11
12#include <glm/gtc/integer.hpp>
13
14namespace Spices {
15
17 {
19
20 if (flags & Querier::Timestamp)
21 {
22 m_Queries[glm::log2((int)Querier::Timestamp)] = std::make_unique<TimestampQuerier>(state);
23 }
24
25 if (flags & Querier::Pipeline)
26 {
27 m_Queries[glm::log2((int)Querier::Pipeline)] = std::make_unique<PipelineStatisticsQuerier>(state);
28 }
29 }
30
31 void RenderPassStatistics::BeginStatistics(VkCommandBuffer commandBuffer, Querier::StatisticsFlags flags) const
32 {
34
35 for (auto& queryer : m_Queries)
36 {
37 if (!queryer) continue;
38
39 if (queryer->GetStatisticsType() & flags)
40 {
41 queryer->BeginQuery(commandBuffer);
42 }
43 }
44 }
45
46 void RenderPassStatistics::EndStatistics(VkCommandBuffer commandBuffer, Querier::StatisticsFlags flags) const
47 {
49
50 for (const auto& querier : m_Queries)
51 {
52 if (!querier) continue;
53
54 if (querier->GetStatisticsType() & flags)
55 {
56 querier->EndQuery(commandBuffer);
57 }
58 }
59 }
60
62 {
64
65 for (auto& querier : m_Queries)
66 {
67 if (querier) querier->StorePoolResult();
68 }
69 }
70}
#define SPICES_PROFILE_ZONE
uint32_t StatisticsFlags
Definition Querier.h:32
Basic interface of Queries.
Definition Querier.h:17
void BeginStatistics(VkCommandBuffer commandBuffer, Querier::StatisticsFlags flags) const
Begin Statistics.
void StoreStatistics() const
Store statistics result.
RenderPassStatistics(VulkanState &state, Querier::StatisticsFlags flags)
Constructor Function.
void EndStatistics(VkCommandBuffer commandBuffer, Querier::StatisticsFlags flags) const
End Statistics.
Statistics of RenderPass(Renderer).
This struct contains all Vulkan object in used global.
Definition VulkanUtils.h:74