Added RegistryCommonModule.cpp
This commit is contained in:
parent
e52f7c13a9
commit
1183e44221
@ -84,6 +84,11 @@ public:
|
||||
rr->static_descriptor.AddUBO(mtl::SBS_ViewportInfo.name,ubo_vp_info);
|
||||
}
|
||||
|
||||
VulkanApplicationFramework()
|
||||
{
|
||||
RegistryCommonGraphModule();
|
||||
}
|
||||
|
||||
virtual ~VulkanApplicationFramework()
|
||||
{
|
||||
CloseShaderCompiler();
|
||||
|
@ -28,6 +28,8 @@ class GraphModule;
|
||||
class RenderModule;
|
||||
class GraphModuleManager;
|
||||
|
||||
void RegistryCommonGraphModule();
|
||||
|
||||
using BindingMap =Map<AnsiString,int>;
|
||||
using BindingMapArray =BindingMap[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
|
||||
|
||||
|
@ -21,20 +21,10 @@ bool RegistryGraphModuleFactory(const char *module_name,GraphModuleFactory *);
|
||||
|
||||
template<typename T> class RegistryGraphModule:public GraphModuleFactory
|
||||
{
|
||||
bool registry_success;
|
||||
|
||||
public:
|
||||
|
||||
RegistryGraphModule()
|
||||
{
|
||||
registry_success=RegistryGraphModuleFactory(T::GetModuleName(),this);
|
||||
}
|
||||
|
||||
GraphModule *Create(GraphModuleManager *gmm) override
|
||||
{
|
||||
if(!registry_success)
|
||||
return(nullptr);
|
||||
|
||||
if(!gmm)
|
||||
return(nullptr);
|
||||
|
||||
@ -42,6 +32,6 @@ public:
|
||||
}
|
||||
};//template<typename T> class RegistryGraphModule:public GraphModuleFactory
|
||||
|
||||
#define REGISTRY_GRAPH_MODULE(Class) namespace{static RegistryGraphModule<Class> registry_##Class;}
|
||||
#define REGISTRY_GRAPH_MODULE(Class) {RegistryGraphModuleFactory(#Class,new RegistryGraphModule<Class##Module>);}
|
||||
|
||||
VK_NAMESPACE_END
|
@ -286,6 +286,7 @@ SET(GRAPH_MODULE_HEADER ${SGM_HEADER_PATH}/GraphModule.h
|
||||
SET(GRAPH_MODULE_SOURCE module/GraphModule.cpp
|
||||
module/GraphModuleFactory.cpp
|
||||
module/RenderModule.cpp
|
||||
module/RegistryCommonModule.cpp
|
||||
module/SwapchainModule.cpp)
|
||||
|
||||
SET(RENDER_FRAMEWORK_FILES ${SG_INCLUDE_PATH}/RenderFramework.h
|
||||
|
11
src/SceneGraph/module/RegistryCommonModule.cpp
Normal file
11
src/SceneGraph/module/RegistryCommonModule.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include<hgl/graph/module/GraphModuleFactory.h>
|
||||
#include<hgl/graph/module/SwapchainModule.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
void RegistryCommonGraphModule()
|
||||
{
|
||||
REGISTRY_GRAPH_MODULE(Swapchain)
|
||||
}
|
||||
|
||||
VK_NAMESPACE_END
|
@ -3,6 +3,4 @@
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
//REGISTRY_GRAPH_MODULE(SwapchainModule)
|
||||
|
||||
VK_NAMESPACE_END
|
||||
|
Loading…
x
Reference in New Issue
Block a user