Forráskód Böngészése

Vulkan: Update current layout for FB attachments after render-pass ends, to reflect automatic layout transitions performed by sub-pass dependencies

BearishSun 9 éve
szülő
commit
6d2ccd4411

+ 10 - 0
Source/BansheeVulkanRenderAPI/Source/BsVulkanCommandBuffer.cpp

@@ -337,6 +337,16 @@ namespace bs
 
 		mQueuedEvents.clear();
 
+		// Update any layout transitions that were performed by subpass dependencies
+		for (auto& entry : mImages)
+		{
+			UINT32 imageInfoIdx = entry.second;
+			ImageInfo& imageInfo = mImageInfos[imageInfoIdx];
+
+			imageInfo.currentLayout = imageInfo.finalLayout;
+			imageInfo.requiredLayout = imageInfo.finalLayout;
+		}
+
 		mState = State::Recording;
 	}