From 30756ec1127ecb6dd811b36d95609424343b7146 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Wed, 6 Mar 2019 19:44:48 +0100 Subject: [PATCH] - wrong image transition direction --- src/rendering/vulkan/renderer/vk_postprocess.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rendering/vulkan/renderer/vk_postprocess.cpp b/src/rendering/vulkan/renderer/vk_postprocess.cpp index d91fa74db8..1f299446a8 100644 --- a/src/rendering/vulkan/renderer/vk_postprocess.cpp +++ b/src/rendering/vulkan/renderer/vk_postprocess.cpp @@ -318,19 +318,19 @@ VulkanDescriptorSet *VkPostprocess::GetInput(VkPPRenderPassSetup *passSetup, con VulkanSampler *sampler = GetSampler(input.Filter, input.Wrap); TextureImage tex = GetTexture(input.Type, input.Texture); - write.addCombinedImageSampler(descriptors.get(), index, tex.view, sampler, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); + write.addCombinedImageSampler(descriptors.get(), index, tex.view, sampler, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); - if (*tex.layout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) + if (*tex.layout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) { - barrier.addImage(tex.image, *tex.layout, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_ACCESS_SHADER_READ_BIT, VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); - *tex.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + barrier.addImage(tex.image, *tex.layout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT); + *tex.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; needbarrier = true; } } write.updateSets(fb->device); if (needbarrier) - barrier.execute(fb->GetDrawCommands(), VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT); + barrier.execute(fb->GetDrawCommands(), VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); mFrameDescriptorSets.push_back(std::move(descriptors)); return mFrameDescriptorSets.back().get();