From: Chris Forbes Date: Thu, 29 Aug 2019 18:22:26 +0000 (-0700) Subject: Check whether the underlying format is supported in format_reinterpret tests X-Git-Tag: upstream/1.3.5~1811^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35cf2e8a2950ce725495b2df55998255ec2d2d81;p=platform%2Fupstream%2FVK-GL-CTS.git Check whether the underlying format is supported in format_reinterpret tests Affects: dEQP-VK.image.* VK-GL-CTS Issue: 1969 Change-Id: I4e78351aa8746ebd2f2ea69980f747ded508802b --- diff --git a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp index 9f8b99e..56ef508 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageLoadStoreTests.cpp @@ -939,6 +939,9 @@ void LoadStoreTest::checkSupport (Context& context) const const vk::VkFormatProperties formatProperties (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), m_format)); + const vk::VkFormatProperties imageFormatProperties (vk::getPhysicalDeviceFormatProperties(context.getInstanceInterface(), + context.getPhysicalDevice(), + m_imageFormat)); if (!m_declareImageFormatInShader && !features.shaderStorageImageReadWithoutFormat) TCU_THROW(NotSupportedError, "shaderStorageImageReadWithoutFormat feature not supported"); @@ -951,6 +954,12 @@ void LoadStoreTest::checkSupport (Context& context) const if (m_texture.type() == IMAGE_TYPE_BUFFER && !(formatProperties.bufferFeatures & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)) TCU_THROW(NotSupportedError, "Format not supported for storage texel buffers"); + + if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(imageFormatProperties.optimalTilingFeatures)) + TCU_THROW(NotSupportedError, "Underlying format not supported at all for images"); + + if ((m_texture.type() == IMAGE_TYPE_BUFFER) && !(imageFormatProperties.bufferFeatures)) + TCU_THROW(NotSupportedError, "Underlying format not supported at all for buffers"); } void LoadStoreTest::initPrograms (SourceCollections& programCollection) const