moved device_render_pass to RenderFramework from GPUDevice.

This commit is contained in:
2025-01-18 20:28:14 +08:00
parent 911afc06f6
commit ff8222c256
10 changed files with 120 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include<hgl/graph/VK.h>
#include<hgl/type/Map.h>
@@ -28,14 +28,30 @@ public:
public:
GraphModule * GetModule(const size_t type_hash) {return GetObjectFromList(module_map,type_hash);} ///<取得指定类型的模块
GraphModule * Get(const size_t type_hash) {return GetObjectFromList(module_map,type_hash);} ///<取得指定类型的模块
template<typename T>
T * GetModule() {return(GetModule(typeid(T).hash_code()));} ///<取得指定类型的模块
T * Get() {return((T *)Get(typeid(T).hash_code()));} ///<取得指定类型的模块
bool ConatainsModule(const size_t &type_hash)const {return module_map.ContainsKey(type_hash);} ///<确认是否包含指定类型的模块
bool Contains(const size_t &type_hash)const {return module_map.ContainsKey(type_hash);} ///<确认是否包含指定类型的模块
template<typename T>
bool Contains()const{return Contains(typeid(T).hash_code());} ///<确认是否包含指定类型的模块
bool Registry(GraphModule *); ///<注册一个模块
bool Unregistry(GraphModule *); ///<注销一个模块
template<typename T>
T *GetOrCreate() ///<注册一个模块
{
if(Contains<T>())
return Get<T>();
T *result=new T(device);
Registry(result);
return result;
}
};//class GraphModuleManager
VK_NAMESPACE_END