Skip to content
Permalink
Browse files

- delay postprocess texture destruction until the end of the frame

  • Loading branch information...
dpjudas committed Jun 10, 2019
1 parent 8853872 commit 13cab1c0b61176059a568724721e4043fd1e4234
Showing with 12 additions and 0 deletions.
  1. +11 −0 src/rendering/vulkan/renderer/vk_postprocess.cpp
  2. +1 −0 src/rendering/vulkan/renderer/vk_postprocess.h
@@ -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)
@@ -88,6 +88,7 @@ class VkPPTexture : public PPTextureBackend
{
public:
VkPPTexture(PPTexture *texture);
~VkPPTexture();

VkTextureImage TexImage;
std::unique_ptr<VulkanBuffer> Staging;

0 comments on commit 13cab1c

Please sign in to comment.
You can’t perform that action at this time.