Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
QueryAllocator.hpp
1#pragma once
2
3#include "Common.hpp"
4#include "graphics/GPUObjects.hpp"
5
11public:
12
17 void init(GPUQuery::Type type, uint count);
18
22 uint allocate();
23
27 void resetWritePool();
28
30 VkQueryPool& getWritePool();
31
33 VkQueryPool& getReadPool();
34
36 void clean();
37
38private:
39
40 std::vector<VkQueryPool> _pools;
41 uint _totalCount = 0u;
42 uint _currentCount = 0u;
43 uint _itemSize = 1u;
44};
Type
Definition: GPUTypes.hpp:416
Manages GPU queries allocation in a set of pools. Pools need to be buffered per frame so that we can ...
Definition: QueryAllocator.hpp:10
void init(GPUQuery::Type type, uint count)
Definition: QueryAllocator.cpp:5
std::vector< VkQueryPool > _pools
Per-frame native query pools.
Definition: QueryAllocator.hpp:40
VkQueryPool & getReadPool()
Definition: QueryAllocator.cpp:70
uint _itemSize
Number of hardware queries used for the given query type (two for duration queries,...
Definition: QueryAllocator.hpp:43
uint allocate()
Definition: QueryAllocator.cpp:43
uint _totalCount
Total size of each pool, in queries.
Definition: QueryAllocator.hpp:41
VkQueryPool & getWritePool()
Definition: QueryAllocator.cpp:66
void clean()
Definition: QueryAllocator.cpp:53
void resetWritePool()
Definition: QueryAllocator.cpp:61
uint _currentCount
Current number of allocated queries.
Definition: QueryAllocator.hpp:42