Browse Source

Vulkan: fix sync hazards (#2419)

- write-after-write when blitting to the same image
- missing barrier between compute dispatches if a view has no draws
pezcode 4 years ago
parent
commit
02e4786e04
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/renderer_vk.cpp

+ 8 - 2
src/renderer_vk.cpp

@@ -6958,6 +6958,12 @@ VK_DESTROY
 				, &blitInfo
 				, &blitInfo
 				, filter
 				, filter
 				);
 				);
+
+			setMemoryBarrier(
+				  m_commandBuffer
+				, VK_PIPELINE_STAGE_TRANSFER_BIT
+				, VK_PIPELINE_STAGE_TRANSFER_BIT
+				);
 		}
 		}
 
 
 		if (oldSrcLayout != VK_IMAGE_LAYOUT_UNDEFINED)
 		if (oldSrcLayout != VK_IMAGE_LAYOUT_UNDEFINED)
@@ -7131,8 +7137,8 @@ VK_DESTROY
 					}
 					}
 
 
 					// renderpass external subpass dependencies handle graphics -> compute and compute -> graphics
 					// renderpass external subpass dependencies handle graphics -> compute and compute -> graphics
-					// but not compute -> compute
-					if (wasCompute && isCompute)
+					// but not compute -> compute (possibly also across views if they contain no draw calls)
+					if (wasCompute)
 					{
 					{
 						setMemoryBarrier(
 						setMemoryBarrier(
 							  m_commandBuffer
 							  m_commandBuffer