-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuniformManager.h
38 lines (27 loc) · 1.2 KB
/
uniformManager.h
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
#pragma once
#include "vulkanWrapper/buffer.h"
#include "vulkanWrapper/descriptorSetLayout.h"
#include "vulkanWrapper/descriptorPool.h"
#include "vulkanWrapper/descriptorSet.h"
#include "vulkanWrapper/description.h"
#include "vulkanWrapper/device.h"
#include "vulkanWrapper/commandPool.h"
#include "base.h"
using namespace FF;
class UniformManager {
public:
using Ptr = std::shared_ptr<UniformManager>;
static Ptr create() { return std::make_shared<UniformManager>(); }
UniformManager();
~UniformManager();
void init(const Wrapper::Device::Ptr &device, const Wrapper::CommandPool::Ptr &commandPool, int frameCount);
void update(const VPMatrices &vpMatrices, const ObjectUniform &objectUniform, const int& frameCount);
[[nodiscard]] auto getDescriptorLayout() const { return mDescriptorSetLayout; }
[[nodiscard]] auto getDescriptorSet(int frameCount) const { return mDescriptorSet->getDescriptorSet(frameCount); }
private:
Wrapper::Device::Ptr mDevice{ nullptr };
std::vector<Wrapper::UniformParameter::Ptr> mUniformParams;
Wrapper::DescriptorSetLayout::Ptr mDescriptorSetLayout{ nullptr };
Wrapper::DescriptorPool::Ptr mDescriptorPool{ nullptr };
Wrapper::DescriptorSet::Ptr mDescriptorSet{ nullptr };
};