Don't assume sampling is allowed on linear-tiled YCbCr
authorGary Sweet <gsweet@broadcom.com>
Wed, 6 Jun 2018 12:35:43 +0000 (13:35 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 14 Jun 2018 14:09:25 +0000 (10:09 -0400)
Linear-tiled formats do not have to support sampling.

The api.image_format_properties tests were checking that
sampling was supported for YCbCr in both optimal and linear
tiling.

Affects:

dEQP-VK.api.info.image_format_properties.*.linear.*

Components: Vulkan

VK-GL-CTS issue : 1200

Change-Id: Id2c2aafaca66fe25ecee243f026315a87d3d7abf

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

index e3d41dd..e56042c 100644 (file)
@@ -2477,7 +2477,9 @@ tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format,
 
        if (isYcbcrConversionSupported(context) && (format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR || format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR))
        {
-               const VkFormatFeatureFlags requiredFeatures = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR | VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR;
+               VkFormatFeatureFlags requiredFeatures = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR | VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
+               if (tiling == VK_IMAGE_TILING_OPTIMAL)
+                       requiredFeatures |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR;
 
                results.check((supportedFeatures & requiredFeatures) == requiredFeatures,
                                          getFormatName(format) + string(" must support ") + de::toString(getFormatFeatureFlagsStr(requiredFeatures)));