improved Swapchain&SwapchainRenderTarget

This commit is contained in:
2021-12-15 20:46:33 +08:00
parent 14b9369739
commit ee9be8a4a2
8 changed files with 64 additions and 81 deletions

View File

@@ -5,7 +5,6 @@
#include<hgl/graph/VKImageView.h>
#include<hgl/graph/VKPipeline.h>
#include<hgl/graph/VKCommandBuffer.h>
//#include<hgl/graph/VKDescriptorSet.h>
#include<hgl/graph/VKRenderPass.h>
#include<hgl/graph/VKFramebuffer.h>
#include<hgl/graph/VKDescriptorSets.h>
@@ -42,7 +41,6 @@ GPUDevice::GPUDevice(GPUDeviceAttribute *da)
InitRenderPassManage();
swapchain=nullptr;
swapchainRT=nullptr;
Resize(attr->surface_caps.currentExtent);
@@ -57,7 +55,6 @@ GPUDevice::~GPUDevice()
ClearRenderPassManage();
SAFE_CLEAR(swapchainRT);
SAFE_CLEAR(swapchain);
SAFE_CLEAR(texture_queue);
SAFE_CLEAR(texture_cmd_buf);
@@ -68,13 +65,9 @@ GPUDevice::~GPUDevice()
bool GPUDevice::Resize(const VkExtent2D &extent)
{
SAFE_CLEAR(swapchainRT);
SAFE_CLEAR(swapchain);
attr->RefreshSurfaceCaps();
if(!CreateSwapchain(attr->surface_caps.currentExtent))
return(false);
swapchainRT=CreateSwapchainRenderTarget();
return(true);