preparing newly GraphModule/RenderModule/RenderPassManager/RenderFramework

This commit is contained in:
2025-01-16 02:10:03 +08:00
parent bd0a3d8be1
commit 911afc06f6
12 changed files with 332 additions and 45 deletions

View File

@@ -0,0 +1,41 @@
#pragma once
#include<hgl/graph/VK.h>
#include<hgl/type/Map.h>
VK_NAMESPACE_BEGIN
class GraphModule;
class GraphModuleManager
{
GPUDevice *device;
protected:
List<GraphModule *> module_list;
Map<size_t,GraphModule *> module_map;
public:
GraphModuleManager(GPUDevice *dev){device=dev;}
virtual ~GraphModuleManager();
public:
GPUDevice * GetDevice() {return device;} ///<取得GPU设备
public:
GraphModule * GetModule(const size_t type_hash) {return GetObjectFromList(module_map,type_hash);} ///<取得指定类型的模块
template<typename T>
T * GetModule() {return(GetModule(typeid(T).hash_code()));} ///<取得指定类型的模块
bool ConatainsModule(const size_t &type_hash)const {return module_map.ContainsKey(type_hash);} ///<确认是否包含指定类型的模块
bool Registry(GraphModule *); ///<注册一个模块
bool Unregistry(GraphModule *); ///<注销一个模块
};//class GraphModuleManager
VK_NAMESPACE_END