Permalink
Browse files

Vulkan: Avoid duplicate image pre-transitions (actually eliminated la…

…ter anyway, but a small saving)
  • Loading branch information...
hrydgard committed Nov 29, 2017
1 parent 168d892 commit b52285287d67cc0092ccedde8b2343dbb5da3e38
Showing with 6 additions and 0 deletions.
  1. +6 −0 ext/native/thin3d/VulkanRenderManager.cpp
@@ -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;
}

0 comments on commit b522852

Please sign in to comment.