You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
692 B

#pragma once
#include <vulkan/vulkan_core.h>
#include <vector>
#include <map>
class Buffer;
class Image;
enum class DescriptorSet {
WORLD,
SIMULATION,
MESH
};
class DescriptorPool {
public:
DescriptorPool();
~DescriptorPool();
4 months ago
void bindBuffer(const Buffer& buffer, VkDescriptorType type, DescriptorSet set, uint32_t binding);
void bindImage(const Image& image, VkDescriptorType type, DescriptorSet set, uint32_t binding);
std::map<DescriptorSet, VkDescriptorSet> sets;
4 months ago
std::map<DescriptorSet, VkDescriptorSetLayout> layouts;
VkDescriptorPool handle = VK_NULL_HANDLE;
private:
void createLayout(DescriptorSet set, const std::vector<VkDescriptorSetLayoutBinding> &bindings);
};