Merge vk-gl-cts/vulkan-cts-1.1.3 into vk-gl-cts/vulkan-cts-1.1.4

Change-Id: Iae6020003b47aa1903dfc1f9917383de6a33fb57
diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp
index 095a6e7..a0d0524 100644
--- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp
+++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp
@@ -2070,10 +2070,8 @@
 		VK_CHECK(vkd.queueWaitIdle(queue));
 
 		submitDummySignalAndGetFenceNative(vkd, *device, queue, queueFamilyIndex, *fenceA, config.externalType, handle);
-		{
-			NativeHandle					handleB	(handle);
-			importFence(vkd, *device, *fenceB, config.externalType, handleB, flags);
-		}
+		NativeHandle					handleB	(handle);
+		importFence(vkd, *device, *fenceB, config.externalType, handleB, flags);
 		importFence(vkd, *device, *fenceC, config.externalType, handle, flags);
 
 		VK_CHECK(vkd.queueWaitIdle(queue));
diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp
index 5e13fca..8f97897 100644
--- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp
+++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperationMultiQueueTests.cpp
@@ -252,22 +252,17 @@
 					0u, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &barrier);
 		}
 	}
-	else if ((resource.getType() == RESOURCE_TYPE_BUFFER || isIndirectBuffer(resource.getType()))	&&
-			 writeFamily != readFamily																&&
-			 VK_SHARING_MODE_EXCLUSIVE == sharingMode)
+	else if (resource.getType() == RESOURCE_TYPE_BUFFER || isIndirectBuffer(resource.getType()))
 	{
-		const VkBufferMemoryBarrier barrier =
+		VkBufferMemoryBarrier barrier = makeBufferMemoryBarrier(secondQueue ? 0u : writeSync.accessMask, !secondQueue ? 0u : readSync.accessMask,
+			resource.getBuffer().handle, resource.getBuffer().offset, resource.getBuffer().size);
+
+		if (writeFamily != readFamily && VK_SHARING_MODE_EXCLUSIVE == sharingMode)
 		{
-			VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,	// VkStructureType	sType;
-			DE_NULL,									// const void*		pNext;
-			secondQueue ? 0u : writeSync.accessMask ,	// VkAccessFlags	srcAccessMask;
-			!secondQueue ? 0u : readSync.accessMask,	// VkAccessFlags	dstAccessMask;
-			writeFamily,								// deUint32			srcQueueFamilyIndex;
-			readFamily,									// deUint32			destQueueFamilyIndex;
-			resource.getBuffer().handle,				// VkBuffer			buffer;
-			resource.getBuffer().offset,				// VkDeviceSize		offset;
-			resource.getBuffer().size,					// VkDeviceSize		size;
-		};
+			barrier.srcQueueFamilyIndex = writeFamily;
+			barrier.dstQueueFamilyIndex = readFamily;
+		}
+
 		vk.cmdPipelineBarrier(cmdBuffer, secondQueue ? VkPipelineStageFlags(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT) : writeSync.stageMask, !secondQueue ? VkPipelineStageFlags(VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT) : readSync.stageMask, (VkDependencyFlags)0, 0u, (const VkMemoryBarrier*)DE_NULL, 1u, (const VkBufferMemoryBarrier*)&barrier, 0u, (const VkImageMemoryBarrier *)DE_NULL);
 	}
 }
diff --git a/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp b/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp
index 5fd14c9..3eaf29b 100644
--- a/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp
+++ b/external/vulkancts/modules/vulkan/util/vktExternalMemoryUtil.cpp
@@ -648,7 +648,7 @@
 	{
 		const vk::VkImportFenceWin32HandleInfoKHR	importInfo	=
 		{
-			vk::VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR,
+			vk::VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR,
 			DE_NULL,
 			fence,
 			flags,
@@ -658,8 +658,8 @@
 		};
 
 		VK_CHECK(vkd.importFenceWin32HandleKHR(device, &importInfo));
-		// \note File descriptors and win32 handles behave differently, but this call wil make it seem like they would behave in same way
-		handle.reset();
+		// \note Importing a fence payload from Windows handles does not transfer ownership of the handle to the Vulkan implementation,
+		//   so we do not disown the handle until after all use has complete.
 	}
 	else
 		DE_FATAL("Unknown fence external handle type");
@@ -803,7 +803,7 @@
 	{
 		const vk::VkImportSemaphoreWin32HandleInfoKHR	importInfo	=
 		{
-			vk::VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
+			vk::VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR,
 			DE_NULL,
 			semaphore,
 			flags,
@@ -813,8 +813,8 @@
 		};
 
 		VK_CHECK(vkd.importSemaphoreWin32HandleKHR(device, &importInfo));
-		// \note File descriptors and win32 handles behave differently, but this call wil make it seem like they would behave in same way
-		handle.reset();
+		// \note Importing a semaphore payload from Windows handles does not transfer ownership of the handle to the Vulkan implementation,
+		//   so we do not disown the handle until after all use has complete.
 	}
 	else
 		DE_FATAL("Unknown semaphore external handle type");