-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDescriptorSetFactory.h
More file actions
77 lines (53 loc) · 1.44 KB
/
DescriptorSetFactory.h
File metadata and controls
77 lines (53 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include"DescriptorSetBuilder.h"
#include"DescriptorSetLayoutFactory.h"
struct DescriptorSet;
class DescriptorSetFactory : public std::enable_shared_from_this<DescriptorSetFactory>
{
private:
uint32_t frameIndex;
VkDevice device;
std::shared_ptr<DescriptorSetBuilder> builder;
std::shared_ptr<DescriptorSetLayoutFactory> layoutFactory;
std::array<std::list<VkDescriptorSet>, 2> destructList;
public:
DescriptorSetFactory(VkDevice& d, std::shared_ptr<DescriptorSetBuilder> b
, std::shared_ptr<DescriptorSetLayoutFactory> lf);
~DescriptorSetFactory()
{
for(int i = 0; i < 2; i++)
{
resourceDestruct();
}
#ifdef _DEBUG
std::cout << "DescriptorSetFactory :: ƒfƒXƒgƒ‰ƒNƒ^" << std::endl;
#endif
}
void addDefferedDestruct(VkDescriptorSet& descriptorSet);
void resourceDestruct();
std::shared_ptr<DescriptorSetBuilder> getBuilder()
{
return builder;
}
std::shared_ptr<DescriptorSet> Create(const DescriptorSetProperty& property);
};
struct DescriptorSet
{
VkDescriptorSet descriptorSet;
std::shared_ptr<DescriptorSetLayout> layout;
std::vector<std::shared_ptr<GpuBuffer>> buffer;
std::vector<std::shared_ptr<Texture>> texture;
std::shared_ptr<DescriptorSetFactory> factory;
DescriptorSet(std::shared_ptr<DescriptorSetFactory> f)
{
descriptorSet = nullptr;
layout = nullptr;
buffer.clear();
texture.clear();
factory = f;
}
~DescriptorSet()
{
//factory->addDefferedDestruct(descriptorSet);
}
};