From 8c9c0c597daddb009c37686e8680870524e8faa1 Mon Sep 17 00:00:00 2001 From: Slawomir Cygan Date: Tue, 5 Sep 2017 16:39:12 +0200 Subject: [PATCH] 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 --- .../modules/vulkan/memory/vktMemoryRequirementsTests.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.7.4