- delay postprocess texture destruction until the end of the frame

This commit is contained in:
Magnus Norddahl 2019-06-10 09:13:56 +02:00
parent 8853872bb4
commit 13cab1c0b6
2 changed files with 12 additions and 0 deletions

View file

@ -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)

View file

@ -88,6 +88,7 @@ class VkPPTexture : public PPTextureBackend
{
public:
VkPPTexture(PPTexture *texture);
~VkPPTexture();
VkTextureImage TexImage;
std::unique_ptr<VulkanBuffer> Staging;