Test cmdCopyBuffer with unaligned offsets & sizes

VK-GL-CTS issue: 3686

Components: Vulkan

New tests:
dEQP-VK.api.copy_and_blit.*.buffer_to_buffer.unaligned_regions

Change-Id: I76304689ff5474dcadbbf0bfb2f422939a6dfc27
diff --git a/android/cts/main/vk-master-2022-03-01/api.txt b/android/cts/main/vk-master-2022-03-01/api.txt
index abc354d..0cde95b 100644
--- a/android/cts/main/vk-master-2022-03-01/api.txt
+++ b/android/cts/main/vk-master-2022-03-01/api.txt
@@ -1902,6 +1902,7 @@
 dEQP-VK.api.copy_and_blit.core.image_to_image.array.array_to_array_whole_mipmap_d16_unorm
 dEQP-VK.api.copy_and_blit.core.image_to_image.array.array_to_array_whole_mipmap_d24_unorm_s8_uint
 dEQP-VK.api.copy_and_blit.core.image_to_image.array.array_to_array_whole_mipmap_s8_uint
+dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_optimal_nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_general_nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.2d.r64_uint.r8_uint.general_optimal_nearest
@@ -43486,6 +43487,7 @@
 dEQP-VK.api.copy_and_blit.dedicated_allocation.image_to_image.array.array_to_array_whole_mipmap_d16_unorm
 dEQP-VK.api.copy_and_blit.dedicated_allocation.image_to_image.array.array_to_array_whole_mipmap_d24_unorm_s8_uint
 dEQP-VK.api.copy_and_blit.dedicated_allocation.image_to_image.array.array_to_array_whole_mipmap_s8_uint
+dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_optimal_nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_general_nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.all_formats.color.2d.r64_uint.r8_uint.general_optimal_nearest
@@ -51958,6 +51960,7 @@
 dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.array.array_to_array_whole_mipmap_d16_unorm
 dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.array.array_to_array_whole_mipmap_d24_unorm_s8_uint
 dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.array.array_to_array_whole_mipmap_s8_uint
+dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_optimal_nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.all_formats.color.2d.r64_uint.r8_uint.optimal_general_nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.all_formats.color.2d.r64_uint.r8_uint.general_optimal_nearest
diff --git a/android/cts/main/vk-master/api.txt b/android/cts/main/vk-master/api.txt
index 6dfb6ff..2baa610 100644
--- a/android/cts/main/vk-master/api.txt
+++ b/android/cts/main/vk-master/api.txt
@@ -60318,6 +60318,7 @@
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -184439,6 +184440,7 @@
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -205907,6 +205909,7 @@
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
diff --git a/android/cts/main/vksc-main/api.txt b/android/cts/main/vksc-main/api.txt
index cca1683..3b4809a 100644
--- a/android/cts/main/vksc-main/api.txt
+++ b/android/cts/main/vksc-main/api.txt
@@ -57355,6 +57355,7 @@
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.whole
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.partial
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.regions
+dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.unaligned_regions
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.nearest
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -181477,6 +181478,7 @@
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.whole
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.partial
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.regions
+dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.unaligned_regions
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.nearest
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
index 90b6383..67220ac 100644
--- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
+++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
@@ -11517,6 +11517,31 @@
 
 		group->addChild(new BufferToBufferTestCase(testCtx, "regions", "Multiple regions", params));
 	}
+
+	{
+		TestParams params;
+		params.src.buffer.size	= 32;
+		params.dst.buffer.size	= 32;
+		params.allocationKind	= allocationKind;
+		params.extensionUse		= extensionUse;
+
+		// Copy four unaligned regions
+		for (unsigned int i = 0; i < 4; i++)
+		{
+			const VkBufferCopy bufferCopy
+			{
+				3 + i * 3,	// VkDeviceSize	srcOffset;	3  6   9  12
+				1 + i * 5,	// VkDeviceSize	dstOffset;	1  6  11  16
+				2 + i,		// VkDeviceSize	size;		2  3   4   5
+			};
+
+			CopyRegion copyRegion;
+			copyRegion.bufferCopy = bufferCopy;
+			params.regions.push_back(copyRegion);
+		}
+
+		group->addChild(new BufferToBufferTestCase(testCtx, "unaligned_regions", "Multiple unaligned regions", params));
+	}
 }
 
 void addBlittingImageSimpleTests (tcu::TestCaseGroup* group, TestParams& params)
diff --git a/external/vulkancts/mustpass/main/vk-default/api.txt b/external/vulkancts/mustpass/main/vk-default/api.txt
index 3c4bb44..f65ae0e 100644
--- a/external/vulkancts/mustpass/main/vk-default/api.txt
+++ b/external/vulkancts/mustpass/main/vk-default/api.txt
@@ -60316,6 +60316,7 @@
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.core.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -184438,6 +184439,7 @@
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -205906,6 +205908,7 @@
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.whole
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.partial
 dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.regions
+dEQP-VK.api.copy_and_blit.copy_commands2.buffer_to_buffer.unaligned_regions
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
diff --git a/external/vulkancts/mustpass/main/vksc-default/api.txt b/external/vulkancts/mustpass/main/vksc-default/api.txt
index 332cbde..787d4de 100644
--- a/external/vulkancts/mustpass/main/vksc-default/api.txt
+++ b/external/vulkancts/mustpass/main/vksc-default/api.txt
@@ -57352,6 +57352,7 @@
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.whole
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.partial
 dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.regions
+dEQP-VKSC.api.copy_and_blit.core.buffer_to_buffer.unaligned_regions
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.nearest
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VKSC.api.copy_and_blit.core.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest
@@ -181474,6 +181475,7 @@
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.whole
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.partial
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.regions
+dEQP-VKSC.api.copy_and_blit.dedicated_allocation.buffer_to_buffer.unaligned_regions
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.nearest
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.r32_sfloat_nearest
 dEQP-VKSC.api.copy_and_blit.dedicated_allocation.blit_image.simple_tests.whole.b8g8r8a8_unorm_nearest