diff --git a/CMCore b/CMCore index ca8517f1..5443a589 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit ca8517f146b08bb4df1669218579223ac7bfbcae +Subproject commit 5443a58987ec4fd3fdfb1df72f602c728940321a diff --git a/inc/hgl/graph/VKDevice.h b/inc/hgl/graph/VKDevice.h index 7fd8d23e..b9cf7446 100644 --- a/inc/hgl/graph/VKDevice.h +++ b/inc/hgl/graph/VKDevice.h @@ -30,6 +30,7 @@ struct CopyBufferToImageInfo; class GPUDevice { + GraphModuleManager *graph_module_manager; GPUDeviceAttribute *attr; DeviceQueue *texture_queue; diff --git a/src/SceneGraph/Vulkan/VKDevice.cpp b/src/SceneGraph/Vulkan/VKDevice.cpp index 22ad2725..0d438b10 100644 --- a/src/SceneGraph/Vulkan/VKDevice.cpp +++ b/src/SceneGraph/Vulkan/VKDevice.cpp @@ -9,8 +9,13 @@ #include #include #include +#include VK_NAMESPACE_BEGIN + +GraphModuleManager *InitGraphModuleManager(GPUDevice *dev); +bool ClearGraphModuleManager(GPUDevice *dev); + GPUDevice::GPUDevice(GPUDeviceAttribute *da) { attr=da; @@ -18,6 +23,8 @@ GPUDevice::GPUDevice(GPUDeviceAttribute *da) texture_queue=nullptr; texture_cmd_buf=nullptr; + graph_module_manager=InitGraphModuleManager(this); + InitRenderPassManage(); sc_rt=nullptr; @@ -37,10 +44,15 @@ GPUDevice::~GPUDevice() SAFE_CLEAR(texture_cmd_buf); delete attr; + + //按设计,上面那些rt/queue/cmdbuf都需要走graph_module_manager释放和申请 + ClearGraphModuleManager(this); } bool GPUDevice::Resize(const VkExtent2D &extent) { + graph_module_manager->OnResize(extent); + SAFE_CLEAR(sc_rt); attr->RefreshSurfaceCaps();