Vulkan: Avoid duplicate image pre-transitions (actually eliminated later anyway, but a small saving)

This commit is contained in:
Henrik Rydgård committed 2017-11-30 00:40:55 +01:00
1 parent 168d89284c
commit b52285287d
1 file changed
+6
@@ -687,6 +687,12 @@ VkImageView VulkanRenderManager::BindFramebufferAsTexture(VKRFramebuffer *fb, in
}
}
if (!curRenderStep_->preTransitions.empty() &&
curRenderStep_->preTransitions.back().fb == fb &&
curRenderStep_->preTransitions.back().targetLayout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) {
// We're done.
return fb->color.imageView;
}
curRenderStep_->preTransitions.push_back({ fb, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL });
return fb->color.imageView;
}