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.
|
|
|
#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();
|
|
|
|
|
|
|
|
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;
|
|
|
|
std::map<DescriptorSet, VkDescriptorSetLayout> layouts;
|
|
|
|
VkDescriptorPool handle = VK_NULL_HANDLE;
|
|
|
|
private:
|
|
|
|
|
|
|
|
void createLayout(DescriptorSet set, const std::vector<VkDescriptorSetLayoutBinding> &bindings);
|
|
|
|
};
|