Don't transition images to UNDEFINED if that's their initial known state

This commit is contained in:
baldurk
2019-04-04 13:10:29 +01:00
parent f742344c95
commit ff5f946e1e
+7 -1
View File
@@ -284,8 +284,14 @@ void VulkanResourceManager::SerialiseImageStates(SerialiserType &ser,
state.dstQueueFamilyIndex = t.dstQueueFamilyIndex;
t.image = Unwrap(GetCurrentHandle<VkImage>(liveid));
t.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
ReplacePresentableImageLayout(state.newLayout);
t.newLayout = state.newLayout;
// sanitise the new layout
ReplacePresentableImageLayout(state.newLayout);
if(t.newLayout == VK_IMAGE_LAYOUT_UNDEFINED)
t.newLayout = VK_IMAGE_LAYOUT_GENERAL;
if(state.newLayout == VK_IMAGE_LAYOUT_UNDEFINED)
state.newLayout = VK_IMAGE_LAYOUT_GENERAL;
t.subresourceRange = state.subresourceRange;
barriers.push_back(t);
vec.push_back(std::make_pair(liveid, state));