few update

This commit is contained in:
hyzboy 2024-12-24 02:45:02 +08:00
parent 2516e9cfc1
commit 07b71ec0fe
10 changed files with 26 additions and 28 deletions

2
CMCore

@ -1 +1 @@
Subproject commit ea101386d3705ee56b7a457b5b828c9f7894487d
Subproject commit dbbd145f03cd3d56c8535b9291b710e595d3b625

@ -1 +1 @@
Subproject commit 441ca9ce5558d6825c92c7dd1b9f93b80404fb41
Subproject commit b2f29ef0cfaed232226f5c8460b1694b98fc25bd

2
CMUtil

@ -1 +1 @@
Subproject commit 6582b635c9b93284c29dd7e1bc6dc5ecf59a8705
Subproject commit 5a05612f537391db5cbf4001b93ecbef591e4c2e

View File

@ -26,7 +26,7 @@ private:
GRAPH_MODULE_CONSTRUCT(RenderPassManager)
~RenderPassManager();
bool Init(GraphModulesMap *) override;
bool Init() override;
private:

View File

@ -3,6 +3,7 @@
#include<hgl/graph/VK.h>
#include<hgl/graph/VKDevice.h>
#include<hgl/type/IDName.h>
#include<hgl/type/StrChar.h>
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:

View File

@ -32,7 +32,7 @@ public:
GRAPH_MODULE_CONSTRUCT(SwapchainModule)
virtual ~SwapchainModule();
bool Init(GraphModulesMap *) override;
bool Init() override;
bool BeginFrame();
void EndFrame();

View File

@ -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<RenderPassManager>();
RenderPass *rp=rpm->AcquireRenderPass(fbi);
RenderPass *rp=rp_manager->AcquireRenderPass(fbi);
if(!rp)return(nullptr);

View File

@ -184,13 +184,8 @@ bool CreateDepthAttachment( List<VkAttachmentReference> &ref_list,List<VkAttachm
return(true);
}
bool RenderPassManager::Init(GraphModulesMap *gmm)
bool RenderPassManager::Init()
{
if(!GraphModule::Init(gmm))
return(false);
gmm->Get(rp_manager);
pipeline_cache=GetDeviceAttribute()->pipeline_cache;
hash=CreateRenderPassHash();

View File

@ -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)

View File

@ -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);