Plasma Engine  2.0
Loading...
Searching...
No Matches
DescriptorSetPoolVulkan.h
1#pragma once
2
3#include <RendererVulkan/RendererVulkanDLL.h>
4
5#include <vulkan/vulkan.hpp>
6
7PL_DEFINE_AS_POD_TYPE(vk::DescriptorType);
8
9template <>
10struct plHashHelper<vk::DescriptorType>
11{
12 PL_ALWAYS_INLINE static plUInt32 Hash(vk::DescriptorType value) { return plHashHelper<plUInt32>::Hash(plUInt32(value)); }
13 PL_ALWAYS_INLINE static bool Equal(vk::DescriptorType a, vk::DescriptorType b) { return a == b; }
14};
15
16class PL_RENDERERVULKAN_DLL plDescriptorSetPoolVulkan
17{
18public:
19 static void Initialize(vk::Device device);
20 static void DeInitialize();
21 static plHashTable<vk::DescriptorType, float>& AccessDescriptorPoolWeights();
22
23 static vk::DescriptorSet CreateDescriptorSet(vk::DescriptorSetLayout layout);
24 static void UpdateDescriptorSet(vk::DescriptorSet descriptorSet, plArrayPtr<vk::WriteDescriptorSet> update);
25 static void ReclaimPool(vk::DescriptorPool& descriptorPool);
26
27private:
28 static constexpr plUInt32 s_uiPoolBaseSize = 1024;
29
30 static vk::DescriptorPool GetNewPool();
31
32 static vk::DescriptorPool s_currentPool;
33 static plHybridArray<vk::DescriptorPool, 4> s_freePools;
34 static vk::Device s_device;
35 static plHashTable<vk::DescriptorType, float> s_descriptorWeights;
36};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition DescriptorSetPoolVulkan.h:17
Definition HashTable.h:333
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Helper struct to calculate the Hash of different types.
Definition HashingUtils.h:75