InitGraphModuleManager/ClearGraphModuleManager in GPUDevice.

This commit is contained in:
hyzboy 2024-10-23 01:12:36 +08:00
parent 62f2e4f819
commit 7a373d6bc0
3 changed files with 14 additions and 1 deletions

2
CMCore

@ -1 +1 @@
Subproject commit ca8517f146b08bb4df1669218579223ac7bfbcae Subproject commit 5443a58987ec4fd3fdfb1df72f602c728940321a

View File

@ -30,6 +30,7 @@ struct CopyBufferToImageInfo;
class GPUDevice class GPUDevice
{ {
GraphModuleManager *graph_module_manager;
GPUDeviceAttribute *attr; GPUDeviceAttribute *attr;
DeviceQueue *texture_queue; DeviceQueue *texture_queue;

View File

@ -9,8 +9,13 @@
#include<hgl/graph/VKFramebuffer.h> #include<hgl/graph/VKFramebuffer.h>
#include<hgl/graph/VKDescriptorSet.h> #include<hgl/graph/VKDescriptorSet.h>
#include<hgl/graph/VKDeviceRenderPassManage.h> #include<hgl/graph/VKDeviceRenderPassManage.h>
#include<hgl/graph/module/GraphModule.h>
VK_NAMESPACE_BEGIN VK_NAMESPACE_BEGIN
GraphModuleManager *InitGraphModuleManager(GPUDevice *dev);
bool ClearGraphModuleManager(GPUDevice *dev);
GPUDevice::GPUDevice(GPUDeviceAttribute *da) GPUDevice::GPUDevice(GPUDeviceAttribute *da)
{ {
attr=da; attr=da;
@ -18,6 +23,8 @@ GPUDevice::GPUDevice(GPUDeviceAttribute *da)
texture_queue=nullptr; texture_queue=nullptr;
texture_cmd_buf=nullptr; texture_cmd_buf=nullptr;
graph_module_manager=InitGraphModuleManager(this);
InitRenderPassManage(); InitRenderPassManage();
sc_rt=nullptr; sc_rt=nullptr;
@ -37,10 +44,15 @@ GPUDevice::~GPUDevice()
SAFE_CLEAR(texture_cmd_buf); SAFE_CLEAR(texture_cmd_buf);
delete attr; delete attr;
//按设计上面那些rt/queue/cmdbuf都需要走graph_module_manager释放和申请
ClearGraphModuleManager(this);
} }
bool GPUDevice::Resize(const VkExtent2D &extent) bool GPUDevice::Resize(const VkExtent2D &extent)
{ {
graph_module_manager->OnResize(extent);
SAFE_CLEAR(sc_rt); SAFE_CLEAR(sc_rt);
attr->RefreshSurfaceCaps(); attr->RefreshSurfaceCaps();