Fix image barriers in image to image copy tests

The same image barriers are used twice if clearDestination is used,
the oldLayout of the second barrier does not match the current layout of
the image

Components: Vulkan

VK-GL-CTS issue: 3956

Affected tests:
dEQP-VK.api.copy_and_blit.*.image_to_image.*

Change-Id: I2623e70f3d4f0b97f9f941e4e6cb2760fd2c9d74
diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
index 6fc04a1..9232d99 100644
--- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
+++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
@@ -1118,7 +1118,7 @@
 		}
 	}
 
-	const VkImageMemoryBarrier	imageBarriers[]		=
+	VkImageMemoryBarrier	imageBarriers[]		=
 	{
 		// source image
 		{
@@ -1173,6 +1173,8 @@
 		clearColor.float32[2] = 1.0f;
 		clearColor.float32[3] = 1.0f;
 		vk.cmdClearColorImage(*m_cmdBuffer, m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clearColor, 1u, &range);
+		imageBarriers[0].oldLayout = imageBarriers[0].newLayout;
+		imageBarriers[1].oldLayout = imageBarriers[1].newLayout;
 		vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers);
 	}