Merge vk-gl-cts/vulkan-cts-1.1.0 into vk-gl-cts/vulkan-cts-1.1.1

Change-Id: I4e418414ad3adf232f210cacb3e84881ae94d98e
diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentClearTests.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentClearTests.cpp
index fbff6e1..f987f14 100644
--- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentClearTests.cpp
+++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentClearTests.cpp
@@ -253,6 +253,7 @@
 	vk.cmdEndRenderPass(*cmdBuffer);
 
 	{
+		// Image validator reads image in compute shader
 		const vk::VkImageMemoryBarrier	endImgBarrier		=
 		{
 			vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,			// sType
@@ -273,8 +274,8 @@
 			}
 		};
 		vk.cmdPipelineBarrier(*cmdBuffer,
-							  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
 							  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+							  vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
 							  (vk::VkDependencyFlags)0,
 							  0, (const vk::VkMemoryBarrier*)DE_NULL,
 							  0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentLoadTests.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentLoadTests.cpp
index 79b7386..ca2587b 100644
--- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentLoadTests.cpp
+++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemAttachmentLoadTests.cpp
@@ -181,6 +181,7 @@
 	vk.cmdEndRenderPass(*cmdBuffer);
 
 	{
+		// Image validator reads image in compute shader
 		const vk::VkImageMemoryBarrier	endImgBarrier		=
 		{
 			vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,			// sType
@@ -201,8 +202,8 @@
 			}
 		};
 		vk.cmdPipelineBarrier(*cmdBuffer,
-								vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
 								vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+								vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
 								(vk::VkDependencyFlags)0,
 								0, (const vk::VkMemoryBarrier*)DE_NULL,
 								0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageToBufferTests.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageToBufferTests.cpp
index 90b04df..5e78eaa 100644
--- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageToBufferTests.cpp
+++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageToBufferTests.cpp
@@ -189,7 +189,7 @@
 
 		vk.cmdPipelineBarrier(targetCmdBuffer,
 							  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-							  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+							  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
 							  (vk::VkDependencyFlags)0,
 							  0, (const vk::VkMemoryBarrier*)DE_NULL,
 							  0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -231,39 +231,14 @@
 		};
 
 		vk.cmdPipelineBarrier(targetCmdBuffer,
-							  vk::VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
-							  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+							  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+							  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
 							  (vk::VkDependencyFlags)0,
 							  0, (const vk::VkMemoryBarrier*)DE_NULL,
 							  0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
 							  1, &initializeBarrier);
 	}
 
-	// Start destination buffer barrier
-	{
-		const vk::VkBufferMemoryBarrier	startBufferBarrier		=
-		{
-			vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,		// VkStructureType		sType
-			DE_NULL,											// const void*			pNext
-			0,													// VkAccessFlags		srcAccessMask
-			vk::VK_ACCESS_TRANSFER_WRITE_BIT,					// VkAccessFlags		dstAccessMask
-			queueFamilyIndex,									// uint32_t				srcQueueFamilyIndex
-			queueFamilyIndex,									// uint32_t				dstQueueFamilyIndex
-			**dstBuffer,										// VkBuffer				buffer
-			0u,													// VkDeviceSize			offset
-			VK_WHOLE_SIZE,										// VkDeviceSize			size
-		};
-
-		vk.cmdPipelineBarrier(targetCmdBuffer,
-							  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-							  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-							  (vk::VkDependencyFlags)0,
-							  0, (const vk::VkMemoryBarrier*)DE_NULL,
-							  1, &startBufferBarrier,
-							  0, (const vk::VkImageMemoryBarrier*)DE_NULL);
-	}
-
-
 	// Copy image to buffer
 	const vk::VkImageSubresourceLayers	subresourceLayers	=
 	{
@@ -286,6 +261,7 @@
 	vk.cmdCopyImageToBuffer(targetCmdBuffer, **colorImage, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, **dstBuffer, 1u, &copyRegion);
 
 	{
+		// Buffer validator reads buffer in compute shader
 		const vk::VkBufferMemoryBarrier	endBufferBarrier		=
 		{
 			vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,		// VkStructureType		sType
@@ -299,8 +275,8 @@
 			VK_WHOLE_SIZE,										// VkDeviceSize			size
 		};
 		vk.cmdPipelineBarrier(targetCmdBuffer,
-								vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
 								vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+								vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
 								(vk::VkDependencyFlags)0,
 								0, (const vk::VkMemoryBarrier*)DE_NULL,
 								1, &endBufferBarrier,
diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemFillUpdateCopyBufferTests.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemFillUpdateCopyBufferTests.cpp
index f6b51dc..c5900d0 100644
--- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemFillUpdateCopyBufferTests.cpp
+++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemFillUpdateCopyBufferTests.cpp
@@ -192,25 +192,6 @@
 	switch (m_cmdType) {
 		case FILL_BUFFER:
 			{
-				const vk::VkBufferMemoryBarrier startFillBufferBarrier =
-				{
-					vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,	// VkStructureType		sType
-					DE_NULL,										// const void*			pNext
-					0,												// VkAccessFlags		srcAccessMask
-					vk::VK_ACCESS_TRANSFER_WRITE_BIT,				// VkAccessFlags		dstAccessMask
-					queueFamilyIndex,								// uint32_t				srcQueueFamilyIndex
-					queueFamilyIndex,								// uint32_t				dstQueueFamilyIndex
-					**dstBuffer,									// VkBuffer				buffer
-					0u,												// VkDeviceSize			offset
-					VK_WHOLE_SIZE,									// VkDeviceSize			size
-				};
-				vk.cmdPipelineBarrier(targetCmdBuffer,
-									  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-									  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-									  (vk::VkDependencyFlags) 0,
-									  0, (const vk::VkMemoryBarrier *) DE_NULL,
-									  1, &startFillBufferBarrier,
-									  0, (const vk::VkImageMemoryBarrier *) DE_NULL);
 				// Fill buffer
 				vk.cmdFillBuffer(targetCmdBuffer, **dstBuffer, 0u, VK_WHOLE_SIZE, m_fillValue);
 				break;
@@ -218,25 +199,6 @@
 
 		case UPDATE_BUFFER:
 			{
-				const vk::VkBufferMemoryBarrier startUpdateBufferBarrier =
-				{
-					vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,	// VkStructureType		sType
-					DE_NULL,										// const void*			pNext
-					0,												// VkAccessFlags		srcAccessMask
-					vk::VK_ACCESS_TRANSFER_WRITE_BIT,				// VkAccessFlags		dstAccessMask
-					queueFamilyIndex,								// uint32_t				srcQueueFamilyIndex
-					queueFamilyIndex,								// uint32_t				dstQueueFamilyIndex
-					**dstBuffer,									// VkBuffer				buffer
-					0u,												// VkDeviceSize			offset
-					VK_WHOLE_SIZE,									// VkDeviceSize			size
-				};
-				vk.cmdPipelineBarrier(targetCmdBuffer,
-									  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-									  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-									  (vk::VkDependencyFlags) 0,
-									  0, (const vk::VkMemoryBarrier *) DE_NULL,
-									  1, &startUpdateBufferBarrier,
-									  0, (const vk::VkImageMemoryBarrier *) DE_NULL);
 				// Update buffer
 				deUint32 data[BUFFER_SIZE];
 				for (size_t ndx = 0; ndx < BUFFER_SIZE; ndx++)
@@ -247,30 +209,9 @@
 
 		case COPY_BUFFER:
 			{
-				// Start src buffer barrier
-				const vk::VkBufferMemoryBarrier startBufferBarrier =
-				{
-					vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,	// VkStructureType		sType
-					DE_NULL,										// const void*			pNext
-					0,												// VkAccessFlags		srcAccessMask
-					vk::VK_ACCESS_TRANSFER_WRITE_BIT,				// VkAccessFlags		dstAccessMask
-					queueFamilyIndex,								// uint32_t				srcQueueFamilyIndex
-					queueFamilyIndex,								// uint32_t				dstQueueFamilyIndex
-					**srcBuffer,									// VkBuffer				buffer
-					0u,												// VkDeviceSize			offset
-					VK_WHOLE_SIZE,									// VkDeviceSize			size
-				};
-				vk.cmdPipelineBarrier(targetCmdBuffer,
-									  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-									  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-									  (vk::VkDependencyFlags) 0,
-									  0, (const vk::VkMemoryBarrier *) DE_NULL,
-									  1, &startBufferBarrier,
-									  0, (const vk::VkImageMemoryBarrier *) DE_NULL);
 				vk.cmdFillBuffer(targetCmdBuffer, **srcBuffer, 0u, VK_WHOLE_SIZE, m_fillValue);
 
-				// Barrier to change accessMask to transfer read bit for source buffer
-				const vk::VkBufferMemoryBarrier startCopyBufferBarrier	=
+				const vk::VkBufferMemoryBarrier copyBufferBarrier	=
 				{
 					vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,		// VkStructureType		sType
 					DE_NULL,											// const void*			pNext
@@ -283,32 +224,14 @@
 					VK_WHOLE_SIZE,										// VkDeviceSize			size
 				};
 
-				// Image barrier for destination buffer
-				const vk::VkBufferMemoryBarrier	dstBufferBarrier		=
-				{
-					vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,		// VkStructureType		sType
-					DE_NULL,											// const void*			pNext
-					0,													// VkAccessFlags		srcAccessMask
-					vk::VK_ACCESS_TRANSFER_WRITE_BIT,					// VkAccessFlags		dstAccessMask
-					queueFamilyIndex,									// uint32_t				srcQueueFamilyIndex
-					queueFamilyIndex,									// uint32_t				dstQueueFamilyIndex
-					**dstBuffer,										// VkBuffer				buffer
-					0u,													// VkDeviceSize			offset
-					VK_WHOLE_SIZE,										// VkDeviceSize			size
-				};
-
-				const vk::VkBufferMemoryBarrier memoryBarriers[2] =
-				{
-					startCopyBufferBarrier,
-					dstBufferBarrier
-				};
 				vk.cmdPipelineBarrier(targetCmdBuffer,
-									  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-									  vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+									  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+									  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
 									  (vk::VkDependencyFlags)0,
 									  0, (const vk::VkMemoryBarrier*)DE_NULL,
-									  2, memoryBarriers,
+									  1, &copyBufferBarrier,
 									  0, (const vk::VkImageMemoryBarrier*)DE_NULL);
+
 				// Copy buffer
 				const vk::VkBufferCopy				copyBufferRegion		=
 				{
@@ -326,6 +249,7 @@
 	}
 
 	{
+		// Buffer validator reads buffer in compute shader
 		const vk::VkBufferMemoryBarrier	endBufferBarrier		=
 		{
 			vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,		// VkStructureType		sType
@@ -339,8 +263,8 @@
 			VK_WHOLE_SIZE,										// VkDeviceSize			size
 		};
 		vk.cmdPipelineBarrier(targetCmdBuffer,
-							  vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
 							  vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+							  vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
 							  (vk::VkDependencyFlags)0,
 							  0, (const vk::VkMemoryBarrier*)DE_NULL,
 							  1, &endBufferBarrier,