Explorar el Código

Bugfix: Properly transition Vulkan images to a read-only layout if they were bound as a shader attachment in a previous render pass

BearishSun hace 8 años
padre
commit
0f50d4e94e
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      Source/BansheeVulkanRenderAPI/BsVulkanCommandBuffer.cpp

+ 9 - 1
Source/BansheeVulkanRenderAPI/BsVulkanCommandBuffer.cpp

@@ -2217,7 +2217,15 @@ namespace bs { namespace ct
 						resetRenderPass = true;
 				}
 				else
-					resetRenderPass = false;
+				{
+					// Subresource has been bound as shader input, and it wasn't bound as a FB attachment this render pass.
+					// However is could have been bound in a previous pass, so check the layouts and force a layout
+					// transition if required.
+					if (subresourceInfo.currentLayout != subresourceInfo.requiredLayout)
+						resetRenderPass = true;
+					else
+						resetRenderPass = false;
+				}
 			}
 		}