Revert "-got rid of shared_ptr in postprocessing system"

This reverts commit 40872a2b21.

This crashed on Vulkan in a very weird way.
This commit is contained in:
Christoph Oelckers 2022-06-09 09:16:58 +02:00
commit 013f2003e8
4 changed files with 28 additions and 42 deletions

View file

@ -364,7 +364,7 @@ VkPPTexture::VkPPTexture(PPTexture *texture)
ImageBuilder imgbuilder;
imgbuilder.setFormat(format);
imgbuilder.setSize(texture->Width, texture->Height);
if (texture->Data.Size())
if (texture->Data)
imgbuilder.setUsage(VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT);
else
imgbuilder.setUsage(VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
@ -379,7 +379,7 @@ VkPPTexture::VkPPTexture(PPTexture *texture)
TexImage.View = viewbuilder.create(fb->device);
TexImage.View->SetDebugName("VkPPTextureView");
if (texture->Data.Size())
if (texture->Data)
{
size_t totalsize = texture->Width * texture->Height * pixelsize;
BufferBuilder stagingbuilder;
@ -393,7 +393,7 @@ VkPPTexture::VkPPTexture(PPTexture *texture)
barrier0.execute(fb->GetTransferCommands());
void *data = Staging->Map(0, totalsize);
memcpy(data, texture->Data.Data(), totalsize);
memcpy(data, texture->Data.get(), totalsize);
Staging->Unmap();
VkBufferImageCopy region = {};