zengine/engine/modules/render/vulkan/include/vkn/backend.h

30 lines
623 B
C
Raw Normal View History

2024-08-17 18:01:21 +08:00
#pragma once
2024-08-27 20:21:32 +08:00
#include "vkn/type.h"
2024-10-27 22:37:35 +08:00
#include "wrapper/descriptorpool.h"
2024-08-17 18:01:21 +08:00
namespace vkn {
2024-08-23 22:13:05 +08:00
class Device;
class Instance;
2024-08-17 18:01:21 +08:00
class Backend {
2024-08-23 22:13:05 +08:00
protected:
Instance* mInstance;
Device* mDevice;
2024-10-27 22:37:35 +08:00
DescriptorPool* mPool;
2024-08-23 22:13:05 +08:00
public:
Backend(string_view appName);
~Backend();
2024-08-27 20:21:32 +08:00
template<typename Worker>
Worker* InitWorker(Name name, VkCommandPoolCreateFlags flag);
2024-08-30 22:09:05 +08:00
Instance& GetInstance() {
return *mInstance;
}
Device& GetDevice() {
return *mDevice;
}
2024-10-27 22:37:35 +08:00
DescriptorPool& GetPool() {
return *mPool;
}
2024-08-23 22:13:05 +08:00
public:
2024-08-27 20:21:32 +08:00
static struct BufferWorker* TransferWorker;
static struct CommandWorker* RenderWorker;
2024-08-17 18:01:21 +08:00
};
2024-08-23 22:13:05 +08:00
};