Added "RenderFramework *" in GraphModule and IRenderTarget
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/graph/VK.h>
|
||||
#include<hgl/type/TypeInfo.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
class TextureManager;
|
||||
class RenderTargetManager;
|
||||
class RenderPassManager;
|
||||
|
||||
class GraphModule
|
||||
{
|
||||
GPUDevice *device;
|
||||
RenderFramework *render_framework;
|
||||
|
||||
public:
|
||||
|
||||
GPUDevice * GetDevice () {return device;} ///<取得GPU设备
|
||||
VkDevice GetVkDevice ()const {return device->GetDevice();} ///<取得VkDevice
|
||||
const GPUPhysicalDevice * GetPhysicalDevice ()const {return device->GetPhysicalDevice();} ///<取得物理设备
|
||||
GPUDeviceAttribute *GetDeviceAttribute () {return device->GetDeviceAttribute();} ///<取得设备属性
|
||||
RenderFramework * GetRenderFramework ()const{return render_framework;} ///<取得渲染框架
|
||||
GPUDevice * GetDevice (); ///<取得GPU设备
|
||||
VkDevice GetVkDevice ()const; ///<取得VkDevice
|
||||
const GPUPhysicalDevice * GetPhysicalDevice ()const; ///<取得物理设备
|
||||
GPUDeviceAttribute *GetDeviceAttribute ()const; ///<取得设备属性
|
||||
VkPipelineCache GetPipelineCache ()const; ///<取得PipelineCache
|
||||
|
||||
public:
|
||||
|
||||
@@ -22,7 +28,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
GraphModule(GPUDevice *dev){device=dev;}
|
||||
GraphModule(RenderFramework *rf){render_framework=rf;}
|
||||
virtual ~GraphModule()=default;
|
||||
|
||||
virtual const size_t GetTypeHash()const noexcept=0;
|
||||
@@ -47,7 +53,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
GraphModuleInherit(GPUDevice *dev,const AnsiString &name):BASE(dev)
|
||||
GraphModuleInherit(RenderFramework *rf,const AnsiString &name):BASE(rf)
|
||||
{
|
||||
manager_name=name;
|
||||
}
|
||||
@@ -57,6 +63,6 @@ public:
|
||||
|
||||
#define GRAPH_MODULE_CLASS(class_name) class class_name:public GraphModuleInherit<class_name,GraphModule>
|
||||
|
||||
#define GRAPH_MODULE_CONSTRUCT(class_name) class_name::class_name(GPUDevice *dev):GraphModuleInherit<class_name,GraphModule>(dev,#class_name)
|
||||
#define GRAPH_MODULE_CONSTRUCT(class_name) class_name::class_name(RenderFramework *rf):GraphModuleInherit<class_name,GraphModule>(rf,#class_name)
|
||||
|
||||
VK_NAMESPACE_END
|
||||
|
@@ -5,11 +5,9 @@
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
class GraphModule;
|
||||
|
||||
class GraphModuleManager
|
||||
{
|
||||
GPUDevice *device;
|
||||
RenderFramework *render_framework;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -18,13 +16,14 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
GraphModuleManager(GPUDevice *dev){device=dev;}
|
||||
GraphModuleManager(RenderFramework *rf){render_framework=rf;}
|
||||
|
||||
virtual ~GraphModuleManager();
|
||||
|
||||
public:
|
||||
|
||||
GPUDevice * GetDevice() {return device;} ///<取得GPU设备
|
||||
RenderFramework * GetRenderFramework ()const{return render_framework;} ///<取得渲染框架
|
||||
GPUDevice * GetDevice ()const; ///<取得GPU设备
|
||||
|
||||
public:
|
||||
|
||||
@@ -46,7 +45,7 @@ public:
|
||||
if(Contains<T>())
|
||||
return Get<T>();
|
||||
|
||||
T *result=new T(device);
|
||||
T *result=new T(render_framework);
|
||||
|
||||
Registry(result);
|
||||
|
||||
|
@@ -15,15 +15,13 @@ inline util::Hash *CreateRenderPassHash()
|
||||
|
||||
GRAPH_MODULE_CLASS(RenderPassManager)
|
||||
{
|
||||
VkPipelineCache pipeline_cache;
|
||||
|
||||
util::Hash *hash;
|
||||
|
||||
Map<RenderPassHASHCode,RenderPass *> RenderPassList;
|
||||
|
||||
private:
|
||||
|
||||
RenderPassManager(GPUDevice *);
|
||||
RenderPassManager(RenderFramework *);
|
||||
~RenderPassManager();
|
||||
|
||||
friend class GraphModuleManager;
|
||||
|
@@ -14,7 +14,7 @@ GRAPH_MODULE_CLASS(RenderTargetManager)
|
||||
|
||||
public:
|
||||
|
||||
RenderTargetManager(GPUDevice *,TextureManager *tm,RenderPassManager *rpm);
|
||||
RenderTargetManager(RenderFramework *,TextureManager *tm,RenderPassManager *rpm);
|
||||
virtual ~RenderTargetManager()=default;
|
||||
|
||||
public: //FrameBuffer相关
|
||||
|
@@ -4,10 +4,6 @@
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
class RenderTargetManager;
|
||||
class RenderPassManager;
|
||||
class RenderPass;
|
||||
|
||||
GRAPH_MODULE_CLASS(SwapchainModule)
|
||||
{
|
||||
TextureManager * tex_manager =nullptr;
|
||||
@@ -30,7 +26,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
SwapchainModule(GPUDevice *,TextureManager *tm,RenderTargetManager *rtm,RenderPassManager *rpm);
|
||||
SwapchainModule(RenderFramework *,TextureManager *tm,RenderTargetManager *rtm,RenderPassManager *rpm);
|
||||
virtual ~SwapchainModule();
|
||||
|
||||
// RenderCmdBuffer *BeginRender();
|
||||
@@ -41,10 +37,10 @@ public:
|
||||
|
||||
RenderPass * GetRenderPass ()const{return sc_render_pass;}
|
||||
|
||||
const VkExtent2D & GetSwapchainSize()const{return sc_render_target->GetExtent();}
|
||||
const VkExtent2D & GetSwapchainSize()const;
|
||||
|
||||
SwapchainRenderTarget * GetRenderTarget ()const{return sc_render_target;}
|
||||
IRenderTarget * AcquireNextImage()const{return sc_render_target->AcquireNextImage();}
|
||||
IRenderTarget * AcquireNextImage()const;
|
||||
};//class SwapchainModule:public GraphModule
|
||||
|
||||
VK_NAMESPACE_END
|
||||
|
@@ -34,7 +34,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
TextureManager(GPUDevice *);
|
||||
TextureManager(RenderFramework *rf);
|
||||
virtual ~TextureManager();
|
||||
|
||||
const VkFormatProperties GetFormatProperties(const VkFormat)const;
|
||||
|
Reference in New Issue
Block a user