From 07b71ec0fe7b4538bc8670a3e43cb125f96c2c9a Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 24 Dec 2024 02:45:02 +0800 Subject: [PATCH] few update --- CMCore | 2 +- CMSceneGraph | 2 +- CMUtil | 2 +- inc/hgl/graph/manager/RenderPassManager.h | 2 +- inc/hgl/graph/module/GraphModule.h | 20 +++++++++++-------- inc/hgl/graph/module/SwapchainModule.h | 2 +- .../Vulkan/VKDeviceRenderTarget.cpp | 5 ++--- src/SceneGraph/manager/RenderPassManager.cpp | 7 +------ src/SceneGraph/manager/TextureManager.cpp | 7 +++---- src/SceneGraph/module/GraphModule.cpp | 5 +++-- 10 files changed, 26 insertions(+), 28 deletions(-) diff --git a/CMCore b/CMCore index ea101386..dbbd145f 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit ea101386d3705ee56b7a457b5b828c9f7894487d +Subproject commit dbbd145f03cd3d56c8535b9291b710e595d3b625 diff --git a/CMSceneGraph b/CMSceneGraph index 441ca9ce..b2f29ef0 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 441ca9ce5558d6825c92c7dd1b9f93b80404fb41 +Subproject commit b2f29ef0cfaed232226f5c8460b1694b98fc25bd diff --git a/CMUtil b/CMUtil index 6582b635..5a05612f 160000 --- a/CMUtil +++ b/CMUtil @@ -1 +1 @@ -Subproject commit 6582b635c9b93284c29dd7e1bc6dc5ecf59a8705 +Subproject commit 5a05612f537391db5cbf4001b93ecbef591e4c2e diff --git a/inc/hgl/graph/manager/RenderPassManager.h b/inc/hgl/graph/manager/RenderPassManager.h index c3eb7383..ade8c1d5 100644 --- a/inc/hgl/graph/manager/RenderPassManager.h +++ b/inc/hgl/graph/manager/RenderPassManager.h @@ -26,7 +26,7 @@ private: GRAPH_MODULE_CONSTRUCT(RenderPassManager) ~RenderPassManager(); - bool Init(GraphModulesMap *) override; + bool Init() override; private: diff --git a/inc/hgl/graph/module/GraphModule.h b/inc/hgl/graph/module/GraphModule.h index 2d205d77..648514cb 100644 --- a/inc/hgl/graph/module/GraphModule.h +++ b/inc/hgl/graph/module/GraphModule.h @@ -3,6 +3,7 @@ #include #include #include +#include VK_NAMESPACE_BEGIN @@ -149,18 +150,21 @@ public: virtual bool Init()=0; ///<初始化当前模块 - static const AnsiIDNameSet &GetDependentModules() ///<取得依赖的模块列表 - { - static const AnsiIDNameSet empty; - - return empty; - } + static const char **GetDependentModules(){return nullptr;} ///<取得依赖的模块列表 const int compare(const GraphModule &gm)const override { - auto &dependent_modules_name=GetDependentModules(); + const char **dependent_modules_list=GetDependentModules(); - return(dependent_modules_name.Contains(gm.module_name)?1:-1); //如果我依赖于他,那么我比他大 + if(!dependent_modules_list) + return -1; + + const char *self_module_name=gm.GetName().ToString(); + + if(string_in_list(dependent_modules_list,self_module_name)) + return 1;//如果我依赖于他,那么我比他大 + + return 0; } public: diff --git a/inc/hgl/graph/module/SwapchainModule.h b/inc/hgl/graph/module/SwapchainModule.h index 835a0a06..d4f064e9 100644 --- a/inc/hgl/graph/module/SwapchainModule.h +++ b/inc/hgl/graph/module/SwapchainModule.h @@ -32,7 +32,7 @@ public: GRAPH_MODULE_CONSTRUCT(SwapchainModule) virtual ~SwapchainModule(); - bool Init(GraphModulesMap *) override; + bool Init() override; bool BeginFrame(); void EndFrame(); diff --git a/src/SceneGraph/Vulkan/VKDeviceRenderTarget.cpp b/src/SceneGraph/Vulkan/VKDeviceRenderTarget.cpp index 2963c904..d8867df0 100644 --- a/src/SceneGraph/Vulkan/VKDeviceRenderTarget.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceRenderTarget.cpp @@ -53,10 +53,9 @@ RenderTarget *TextureManager::CreateRT(const FramebufferInfo *fbi,RenderPass *rp RenderTarget *TextureManager::CreateRT(const FramebufferInfo *fbi,const uint32_t fence_count) { if(!fbi)return(nullptr); + if(!rp_manager)return(nullptr); //这个判断理论上不可能成立 - RenderPassManager *rpm=GetModule(); - - RenderPass *rp=rpm->AcquireRenderPass(fbi); + RenderPass *rp=rp_manager->AcquireRenderPass(fbi); if(!rp)return(nullptr); diff --git a/src/SceneGraph/manager/RenderPassManager.cpp b/src/SceneGraph/manager/RenderPassManager.cpp index 658af3d2..1754707e 100644 --- a/src/SceneGraph/manager/RenderPassManager.cpp +++ b/src/SceneGraph/manager/RenderPassManager.cpp @@ -184,13 +184,8 @@ bool CreateDepthAttachment( List &ref_list,ListGet(rp_manager); - pipeline_cache=GetDeviceAttribute()->pipeline_cache; hash=CreateRenderPassHash(); diff --git a/src/SceneGraph/manager/TextureManager.cpp b/src/SceneGraph/manager/TextureManager.cpp index 94847055..11723323 100644 --- a/src/SceneGraph/manager/TextureManager.cpp +++ b/src/SceneGraph/manager/TextureManager.cpp @@ -13,7 +13,8 @@ namespace { const char *tex_manager_dep[] { - "RenderPassManager" + "RenderPassManager", + nullptr //一定要0结尾 }; } @@ -22,10 +23,8 @@ const char **TextureManager::GetDependentModules() return tex_manager_dep; } -bool TextureManager::Init(GraphModulesMap *gmm) +bool TextureManager::Init() { - - GPUDevice *dev=GetDevice(); if(!dev) diff --git a/src/SceneGraph/module/GraphModule.cpp b/src/SceneGraph/module/GraphModule.cpp index c2c61418..516a015f 100644 --- a/src/SceneGraph/module/GraphModule.cpp +++ b/src/SceneGraph/module/GraphModule.cpp @@ -31,11 +31,12 @@ GraphModule::~GraphModule() LOG_INFO("GraphModule::~GraphModule: "+AnsiString(module_name.GetName())) } -bool GraphModule::InitDependentModules(GraphModulesMap *) +bool GraphModule::InitDependentModules(GraphModulesMap *gmm) { auto dm_list=GetDependentModules(); - if(!dm_list.IsEmpty()) + if(!dm_list. + IsEmpty()) { if(!gmm) return(false);