Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
VulkanDescriptorPool.hpp
Go to the documentation of this file.
1 #pragma once
3 #ifdef USING_VULKAN
4 
5 #include <ThirdParty/Vulkan/Include/vulkan/vulkan.hpp>
6 #include <ThirdParty/EASTL-master/include/EASTL/vector.h>
7 
8 namespace Engine {
9 
10  class VulkanLogicalDevice;
11 
12  class VulkanDescriptorPool
13  {
14  public:
15  VulkanDescriptorPool(VulkanLogicalDevice* device);
16  ~VulkanDescriptorPool();
17 
18  void AddPoolSize(VkDescriptorType type, uint32_t count);
19 
20  void Compile(uint32_t maxSets);
21 
22  VkDescriptorPool GetPool() const;
23 
24  void AllocateDescriptorSet(uint32_t descriptorSetCount, VkDescriptorSetLayout* layouts, VkDescriptorSet* sets) const;
25 
26  void DescriptorSetBindToBuffer(VkDescriptorSet set, VkBuffer buffer, VkDeviceSize offset,
27  VkDeviceSize range, uint32_t binding, uint32_t arrayElement,
28  VkDescriptorType type, uint32_t descriptorCount) const;
29 
30  void DescriptorSetBindToImage(VkDescriptorSet set, VkImageLayout layout, VkImageView imageView, VkSampler sampler, uint32_t binding, uint32_t arrayElement, VkDescriptorType type, uint32_t descriptorCount) const;
31 
32  private:
33  eastl::vector<VkDescriptorPoolSize> poolSizes;
34 
35  VkDescriptorPool pool;
36  VulkanLogicalDevice* device;
37  };
38 
39 }
40 
41 #endif // USING_VULKAN