From 6b1b254e2cb6c52787b14bb945aaed6f3a95ccd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20Ka=C5=84toch?= Date: Mon, 23 Sep 2019 18:41:58 +0200 Subject: [PATCH] Add check if usage is supported for image format dEQP-VK.image.swapchain_mutable* tests do not check if the required usage is supported for image format and image view format. Components: Vulkan Affects: dEQP-VK.image.swapchain_mutable* VK-GL-CTS issue: 2015 Change-Id: I6680d9e6ef1b03462afa01349b6f34d82ef40a17 --- .../modules/vulkan/image/vktImageMutableTests.cpp | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp index c40b219..ac0e814 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp @@ -2131,6 +2131,25 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) const VkImageUsageFlags imageUsage = getImageUsageForTestCase(caseDef); + { + VkImageFormatProperties properties; + VkResult result; + + result = vki.getPhysicalDeviceImageFormatProperties(physDevice, caseDef.imageFormat, getImageType(caseDef.imageType), VK_IMAGE_TILING_OPTIMAL, imageUsage, 0, &properties); + + if (result == VK_ERROR_FORMAT_NOT_SUPPORTED) + { + TCU_THROW(NotSupportedError, "Image format is not supported for required usage"); + } + + result = vki.getPhysicalDeviceImageFormatProperties(physDevice, caseDef.viewFormat, getImageType(caseDef.imageType), VK_IMAGE_TILING_OPTIMAL, imageUsage, 0, &properties); + + if (result == VK_ERROR_FORMAT_NOT_SUPPORTED) + { + TCU_THROW(NotSupportedError, "Image view format is not supported for required usage"); + } + } + const VkSurfaceCapabilitiesKHR capabilities = getPhysicalDeviceSurfaceCapabilities(vki, physDevice, *surface); @@ -2140,8 +2159,8 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) // Check support for requested formats by swapchain surface const vector surfaceFormats = getPhysicalDeviceSurfaceFormats(vki, - physDevice, - *surface); + physDevice, + *surface); const VkSurfaceFormatKHR* surfaceFormat = DE_NULL; const VkFormat* viewFormat = DE_NULL; -- 2.7.4