From: Pyry Haulos Date: Mon, 10 Oct 2016 21:42:53 +0000 (-0700) Subject: Do not require TRANSIENT usage support without other RT usages X-Git-Tag: upstream/0.1.0~662^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=377ad0ad5962351d14badb1857b55dc8e8e49218;p=platform%2Fupstream%2FVK-GL-CTS.git Do not require TRANSIENT usage support without other RT usages Affects dEQP-VK.api.info.image_format_properties.* See CTS issue #507 and spec issue #540 Change-Id: Ia3a741c1943eea034a27b9479a0a8b4cc0caa09c --- diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index ee49082..3b6d4a1 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -1694,14 +1694,22 @@ VkImageUsageFlags getValidImageUsageFlags (VkFormat, VkFormatFeatureFlags suppor bool isValidImageUsageFlagCombination (VkImageUsageFlags usage) { - if (usage & vk::VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) + if ((usage & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) != 0) { - const VkImageUsageFlags allowedFlags = vk::VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT - | vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT - | vk::VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT - | vk::VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; - return (usage & ~allowedFlags) == 0; + const VkImageUsageFlags allowedFlags = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT + | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT + | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT + | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + + // Only *_ATTACHMENT_BIT flags can be combined with TRANSIENT_ATTACHMENT_BIT + if ((usage & ~allowedFlags) != 0) + return false; + + // TRANSIENT_ATTACHMENT_BIT is not valid without COLOR_ or DEPTH_STENCIL_ATTACHMENT_BIT + if ((usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) == 0) + return false; } + return usage != 0; }