Permalink
Browse files

Vulkan transitions after render: Add a missing case that seems like i…

…t could be common?
  • Loading branch information...
hrydgard committed Nov 29, 2017
1 parent 4129459 commit 168d89284c146156b694cb73f8678387fda115b8
Showing with 5 additions and 1 deletion.
  1. +5 −1 ext/native/thin3d/VulkanQueueRunner.cpp
@@ -467,7 +467,8 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c
vkCmdEndRenderPass(cmd);
// Transition the framebuffer if requested.
if (fb && step.render.finalColorLayout != VK_IMAGE_LAYOUT_UNDEFINED) {
// Don't need to transition it if VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.
if (fb && step.render.finalColorLayout != VK_IMAGE_LAYOUT_UNDEFINED && step.render.finalColorLayout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) {
VkImageMemoryBarrier barrier{};
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.oldLayout = fb->color.layout;
@@ -490,6 +491,9 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
break;
case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
barrier.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT;
break;
default:
Crash();
}

0 comments on commit 168d892

Please sign in to comment.