From: Slawomir Cygan Date: Tue, 5 Sep 2017 14:39:12 +0000 (+0200) Subject: Do not use ycbcr formats if ycbcr extension is not supported X-Git-Tag: upstream/0.1.0~9^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c9c0c597daddb009c37686e8680870524e8faa1;p=platform%2Fupstream%2FVK-GL-CTS.git Do not use ycbcr formats if ycbcr extension is not supported Spec says (on "vkGetPhysicalDeviceFormatProperties"): "format must be a valid VkFormat value" Formats from future or unsupported extensions do not constitute a "valid VkFormat values". Affects: dEQP-VK.memory.requirements.*.image.* Components: Vulkan VK-GL-CTS issue: 663 Change-Id: Ia284977b830d5fda14bcbd9d96010995d84014d5 --- diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp index 91f348c..5b22b48 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryRequirementsTests.cpp @@ -707,6 +707,7 @@ protected: private: virtual bool isImageSupported (const InstanceInterface& vki, const VkPhysicalDevice physDevice, + const std::vector& deviceExtensions, const VkImageCreateInfo& info); virtual bool isFormatMatchingAspect (const VkFormat format, @@ -866,15 +867,16 @@ bool isUsageMatchesFeatures (const VkImageUsageFlags usage, const VkFormatFeatur } //! This catches both invalid as well as legal but unsupported combinations of image parameters -bool ImageMemoryRequirementsOriginal::isImageSupported (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkImageCreateInfo& info) +bool ImageMemoryRequirementsOriginal::isImageSupported (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector& deviceExtensions, const VkImageCreateInfo& info) { DE_ASSERT(info.extent.width >= 1u && info.extent.height >= 1u && info.extent.depth >= 1u); - if (isYCbCrFormat(info.format) + if ((isYCbCrFormat(info.format) && (info.imageType != VK_IMAGE_TYPE_2D || info.mipLevels != 1 || info.arrayLayers != 1 || info.samples != VK_SAMPLE_COUNT_1_BIT)) + || !de::contains(deviceExtensions.begin(), deviceExtensions.end(), "VK_KHR_sampler_ycbcr_conversion")) { return false; } @@ -1363,7 +1365,7 @@ tcu::TestStatus ImageMemoryRequirementsOriginal::execTest (Context& context, con m_currentTestImageInfo = imageInfo; - if (!isImageSupported(vki, physDevice, m_currentTestImageInfo)) + if (!isImageSupported(vki, physDevice, context.getDeviceExtensions(), m_currentTestImageInfo)) continue; log << tcu::TestLog::Message << "- " << getImageInfoString(m_currentTestImageInfo) << tcu::TestLog::EndMessage;