ordered module_list in RenderFramework

This commit is contained in:
2024-11-19 00:20:35 +08:00
parent 5217df7923
commit 4f335f7230
10 changed files with 63 additions and 34 deletions

View File

@@ -38,6 +38,9 @@ protected:
ObjectList<GraphModule> module_list;
List<GraphModule *> per_frame_module_list;
List<RenderModule *> render_module_list;
protected:
SwapchainModule * swapchain_module =nullptr;
@@ -73,6 +76,12 @@ public: //module
module_list.Add(tm);
if(tm->IsPerFrame())
per_frame_module_list.Add(tm);
if(tm->IsRender())
render_module_list.Add(tm);
return tm;
}

View File

@@ -0,0 +1,11 @@
#pragma once
#include<hgl/graph/module/GraphModule.h>
VK_NAMESPACE_BEGIN
class MaterialManager:public GraphModule
{
};//
VK_NAMESPACE_END

View File

@@ -22,10 +22,10 @@ public:
GraphModuleManager(GPUDevice *dev){device=dev;}
~GraphModuleManager();
GPUDevice * GetDevice ()noexcept{return device;} ///<取得GPU设备
VkDevice GetVkDevice ()const{return device->GetDevice();}
const GPUPhysicalDevice * GetPhysicalDevice ()const{return device->GetPhysicalDevice();} ///<取得物理设备
GPUDeviceAttribute *GetDeviceAttribute (){return device->GetDeviceAttribute();} ///<取得设备属性
GPUDevice * GetDevice ()noexcept {return device;} ///<取得GPU设备
VkDevice GetVkDevice ()const {return device->GetDevice();}
const GPUPhysicalDevice * GetPhysicalDevice ()const {return device->GetPhysicalDevice();} ///<取得物理设备
GPUDeviceAttribute *GetDeviceAttribute () {return device->GetDeviceAttribute();} ///<取得设备属性
/**
* 获取指定名称的模块
@@ -70,6 +70,7 @@ protected:
public:
virtual const bool IsPerFrame () {return false;} ///<是否每帧运行
virtual const bool IsRender () {return false;} ///<是否为渲染模块
GraphModuleManager *GetManager () {return module_manager;} ///<取得模块管理器
@@ -106,7 +107,6 @@ public: //回调事件
virtual void OnResize(const VkExtent2D &){} ///<窗口大小改变
virtual void OnPreFrame(){} ///<帧绘制前回调
virtual void OnExecute(const double,RenderCmdBuffer *){}
virtual void OnPostFrame(){} ///<帧绘制后回调
};//class GraphModule

View File

@@ -14,7 +14,8 @@ class RenderModule:public GraphModule
public:
const bool IsRender()const noexcept{return true;}
const bool IsPerFrame ()const noexcept{return true;} ///<每帧运行
const bool IsRender ()const noexcept{return true;} ///<渲染模块
public:
@@ -25,7 +26,7 @@ public:
virtual void OnResize(const VkExtent2D &ext)override{current_extent=ext;}
virtual void OnExecute(const double,RenderCmdBuffer *){}
virtual void OnFrameRender(const double,RenderCmdBuffer *)=0; ///<帧绘制回调
};//class RenderModule
VK_NAMESPACE_END

View File

@@ -26,8 +26,6 @@ protected:
public:
virtual void OnResize(const VkExtent2D &)override; ///<窗口大小改变
//virtual void OnExecute(const double,RenderCmdBuffer *);
public: