From 55027ea636db82af308750aaaf284b74cdd4b904 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Wed, 14 Apr 2021 10:07:19 +0300 Subject: [PATCH] Choose linear tiling when dmabuf is used in synchronization tests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This change is similar to commit 941682268, with dmabuf import/export we either need to use linear tiling or additional metadata provided with VK_EXT_image_drm_format_modifier extension. Component: Vulkan Affects: dEQP-VK.synchronization.cross_instance* VK-GL-CTS issue: 2887 Signed-off-by: Tapani Pälli Change-Id: I3ef9a49e122aa3cb3025f49263acd7b9caa11c10 --- .../vktSynchronizationCrossInstanceSharingTests.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp index cf19295..73ddddc 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationCrossInstanceSharingTests.cpp @@ -87,6 +87,15 @@ struct TestConfig const bool dedicated; }; +// A helper function to choose tiling type for cross instance sharing tests. +// On Linux, DMABUF requires VK_EXT_image_drm_format_modifier support when +// VK_IMAGE_TILING_OPTIMAL is used, therefore we choose to use linear with these tests. +vk::VkImageTiling chooseTiling(VkExternalMemoryHandleTypeFlagBits memoryHandleType) +{ + // Choose tiling depending on memory handle type + return memoryHandleType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT ? vk::VK_IMAGE_TILING_LINEAR : vk::VK_IMAGE_TILING_OPTIMAL; +} + // A helper class to test for extensions upfront and throw not supported to speed up test runtimes compared to failing only // after creating unnecessary vkInstances. A common example of this is win32 platforms taking a long time to run _fd tests. class NotSupportedChecker @@ -158,7 +167,7 @@ public: &externalInfo, config.resource.imageFormat, config.resource.imageType, - vk::VK_IMAGE_TILING_OPTIMAL, + chooseTiling(config.memoryHandleType), readOp.getInResourceUsageFlags() | writeOp.getOutResourceUsageFlags(), 0u }; @@ -670,7 +679,7 @@ Move createImage(const vk::DeviceInterface& vkd, 1u, 1u, resourceDesc.imageSamples, - vk::VK_IMAGE_TILING_OPTIMAL, + chooseTiling(externalType), readOp.getInResourceUsageFlags() | writeOp.getOutResourceUsageFlags(), vk::VK_SHARING_MODE_EXCLUSIVE, @@ -797,7 +806,7 @@ de::MovePtr importResource (const vk::DeviceInterface& vkd, 1u, 1u, resourceDesc.imageSamples, - vk::VK_IMAGE_TILING_OPTIMAL, + chooseTiling(externalType), readOp.getInResourceUsageFlags() | writeOp.getOutResourceUsageFlags(), vk::VK_SHARING_MODE_EXCLUSIVE, -- 2.7.4