-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathQueryPool.h
45 lines (37 loc) · 983 Bytes
/
QueryPool.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Author : Jihong Shin (snowapril)
#if !defined(VULKAN_FRAMEWORK_GPU_PROFILER)
#define VULKAN_FRAMEWORK_GPU_PROFILER
#include <VulkanFramework/pch.h>
#include <memory>
namespace vfs
{
class Device;
class Counter;
class PipelineBase;
class QueryPool
{
public:
explicit QueryPool() = default;
explicit QueryPool(DevicePtr device, uint32_t numQuery);
~QueryPool();
public:
void destroyQueryPool (void);
bool initialize (DevicePtr device, uint32_t numQuery);
bool readQueryResults (std::vector<uint64_t>* results);
void writeTimeStamp(VkCommandBuffer cmdBuffer, VkPipelineStageFlagBits stageFlag, uint32_t queryIndex);
void resetQueryPool(VkCommandBuffer cmdBuffer);
inline uint32_t getNumQuery(void) const
{
return _numQuery;
}
inline VkQueryPool getHandle(void) const
{
return _queryPool;
}
private:
DevicePtr _device { nullptr };
VkQueryPool _queryPool { VK_NULL_HANDLE };
uint32_t _numQuery { 0 };
};
}
#endif