nngn
Loading...
Searching...
No Matches
descriptor.h
Go to the documentation of this file.
1#ifndef NNGN_GRAPHICS_VULKAN_DESCRIPTOR_H
2#define NNGN_GRAPHICS_VULKAN_DESCRIPTOR_H
3
4#include <cstdint>
5#include <span>
6#include <vector>
7
8#include "utils/utils.h"
9
10#include "vulkan.h"
11
12namespace nngn {
13
15public:
17 DescriptorPool(void) = default;
18 ~DescriptorPool(void);
19 VkDescriptorPool id(void) const { return this->h; }
20 void init(VkDevice dev);
21 bool reset(void) const;
22 bool recreate(
23 std::uint32_t max, std::span<const VkDescriptorPoolSize> sizes);
24 void destroy();
25private:
26 VkDevice dev = {};
28};
29
31public:
33 DescriptorSets(void) = default;
34 ~DescriptorSets(void);
35 VkDescriptorSetLayout layout(void) const { return this->m_layout; }
36 std::span<const VkDescriptorSet> ids(void) const { return this->hs; }
37 bool init(
38 VkDevice dev, std::span<const VkDescriptorSetLayoutBinding> bindings);
39 bool reset(VkDescriptorPool pool, std::uint32_t max);
45 void destroy();
46protected:
47 VkDevice dev = {};
48private:
50 std::vector<VkDescriptorSet> hs = {};
51 std::vector<VkDescriptorType> types = {};
52};
53
54}
55
56#endif
Definition descriptor.h:14
bool reset(void) const
Definition descriptor.cpp:25
void destroy()
Definition descriptor.cpp:47
VkDescriptorPool h
Definition descriptor.h:27
VkDevice dev
Definition descriptor.h:26
bool recreate(std::uint32_t max, std::span< const VkDescriptorPoolSize > sizes)
Definition descriptor.cpp:32
Definition descriptor.h:30
VkDescriptorSetLayout layout(void) const
Definition descriptor.h:35
void destroy()
Destroys resources associated with the sets.
Definition descriptor.cpp:93
VkDevice dev
Definition descriptor.h:47
VkDescriptorSetLayout m_layout
Definition descriptor.h:49
std::vector< VkDescriptorSet > hs
Definition descriptor.h:50
std::span< const VkDescriptorSet > ids(void) const
Definition descriptor.h:36
reset
Definition conway.lua:26
init
Definition img_common.lua:34
Definition audio.cpp:7
COMMAND_BUFFER DESCRIPTOR_POOL VkDescriptorSetLayout
Definition types.h:72
COMMAND_BUFFER VkDescriptorPool
Definition types.h:72
#define NNGN_MOVE_ONLY(x)
Definition utils.h:39
Definition types.h:32