diff --git a/src/rendering/vulkan/renderer/vk_postprocess.cpp b/src/rendering/vulkan/renderer/vk_postprocess.cpp index ab37dd9f1..3f0cc6ea3 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.cpp +++ b/src/rendering/vulkan/renderer/vk_postprocess.cpp @@ -402,6 +402,17 @@ VkPPTexture::VkPPTexture(PPTexture *texture) } } +VkPPTexture::~VkPPTexture() +{ + if (auto fb = GetVulkanFrameBuffer()) + { + if (TexImage.Image) fb->FrameDeleteList.Images.push_back(std::move(TexImage.Image)); + if (TexImage.View) fb->FrameDeleteList.ImageViews.push_back(std::move(TexImage.View)); + if (TexImage.DepthOnlyView) fb->FrameDeleteList.ImageViews.push_back(std::move(TexImage.DepthOnlyView)); + if (Staging) fb->FrameDeleteList.Buffers.push_back(std::move(Staging)); + } +} + ///////////////////////////////////////////////////////////////////////////// VkPPShader::VkPPShader(PPShader *shader) diff --git a/src/rendering/vulkan/renderer/vk_postprocess.h b/src/rendering/vulkan/renderer/vk_postprocess.h index fa50bebca..07f524f86 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.h +++ b/src/rendering/vulkan/renderer/vk_postprocess.h @@ -88,6 +88,7 @@ class VkPPTexture : public PPTextureBackend { public: VkPPTexture(PPTexture *texture); + ~VkPPTexture(); VkTextureImage TexImage; std::unique_ptr Staging;