Provide dedicated image when importing memory if required
authorJesse Hall <jessehall@google.com>
Fri, 11 Aug 2017 17:18:32 +0000 (10:18 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 25 Aug 2017 11:41:26 +0000 (07:41 -0400)
The test was using dedicated images when creating memory to be exported,
but not when importing that same memory.

Affects:

dEQP-VK.api.external.memory.*.dedicated.image.bind_export_import_bind
dEQP-VK.api.external.memory.*.dedicated.image.export_bind_import_bind
dEQP-VK.api.external.memory.*.dedicated.image.export_import_bind_bind

Components: Vulkan

VK-GL-CTS issue: 635

Change-Id: I5a063f10677aca8f373e29e39a34af293bf0a220

external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp

index 13dffec..acf99a1 100644 (file)
@@ -3463,8 +3463,10 @@ tcu::TestStatus testImageBindExportImportBind (Context&                                  context,
        getMemoryNative(vkd, *device, *memoryA, config.externalType, handle);
 
        {
-               const vk::Unique<vk::VkDeviceMemory>    memoryB (importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
                const vk::Unique<vk::VkImage>                   imageB  (createExternalImage(vkd, *device, queueFamilyIndex, config.externalType, format, width, height, tiling, 0u, usage));
+               const vk::Unique<vk::VkDeviceMemory>    memoryB (config.dedicated
+                                                                                                                ? importDedicatedMemory(vkd, *device, *imageB, requirements, config.externalType, exportedMemoryTypeIndex, handle)
+                                                                                                                : importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
 
                VK_CHECK(vkd.bindImageMemory(*device, *imageB, *memoryB, 0u));
        }
@@ -3500,8 +3502,10 @@ tcu::TestStatus testImageExportBindImportBind (Context&                                  context,
        VK_CHECK(vkd.bindImageMemory(*device, *imageA, *memoryA, 0u));
 
        {
-               const vk::Unique<vk::VkDeviceMemory>    memoryB (importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
                const vk::Unique<vk::VkImage>                   imageB  (createExternalImage(vkd, *device, queueFamilyIndex, config.externalType, format, width, height, tiling, 0u, usage));
+               const vk::Unique<vk::VkDeviceMemory>    memoryB (config.dedicated
+                                                                                                                ? importDedicatedMemory(vkd, *device, *imageB, requirements, config.externalType, exportedMemoryTypeIndex, handle)
+                                                                                                                : importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
 
                VK_CHECK(vkd.bindImageMemory(*device, *imageB, *memoryB, 0u));
        }
@@ -3537,8 +3541,10 @@ tcu::TestStatus testImageExportImportBindBind (Context&                                  context,
        getMemoryNative(vkd, *device, *memoryA, config.externalType, handle);
 
        {
-               const vk::Unique<vk::VkDeviceMemory>    memoryB (importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
                const vk::Unique<vk::VkImage>                   imageB  (createExternalImage(vkd, *device, queueFamilyIndex, config.externalType, format, width, height, tiling, 0u, usage));
+               const vk::Unique<vk::VkDeviceMemory>    memoryB (config.dedicated
+                                                                                                                ? importDedicatedMemory(vkd, *device, *imageB, requirements, config.externalType, exportedMemoryTypeIndex, handle)
+                                                                                                                : importMemory(vkd, *device, requirements, config.externalType, exportedMemoryTypeIndex, handle));
 
                VK_CHECK(vkd.bindImageMemory(*device, *imageA, *memoryA, 0u));
                VK_CHECK(vkd.bindImageMemory(*device, *imageB, *memoryB, 0u));