Skip to content

Commit

Permalink
- delay postprocess texture destruction until the end of the frame
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas authored and madame-rachelle committed Jun 11, 2019
1 parent 3b868df commit 505d1f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rendering/vulkan/renderer/vk_postprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/rendering/vulkan/renderer/vk_postprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class VkPPTexture : public PPTextureBackend
{
public:
VkPPTexture(PPTexture *texture);
~VkPPTexture();

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

0 comments on commit 505d1f0

Please sign in to comment.