Skip unsupported attachment formats in granularity tests
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 23 Dec 2016 17:11:14 +0000 (17:11 +0000)
committerPyry Haulos <phaulos@google.com>
Fri, 6 Jan 2017 20:32:41 +0000 (15:32 -0500)
Change-Id: Iffbd79d0ddb3c212f75895c266b3e3ec7d2a01da

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

index 8a6fdd8..9e5582e 100644 (file)
@@ -200,6 +200,14 @@ void GranularityInstance::initImages (void)
                if (!aspectFlags)
                        aspectFlags = VK_IMAGE_ASPECT_COLOR_BIT;
 
+               VkFormatProperties formatProperties;
+               m_context.getInstanceInterface().getPhysicalDeviceFormatProperties(m_context.getPhysicalDevice(),
+                                                                                  it->format, &formatProperties);
+
+               if ((formatProperties.optimalTilingFeatures & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
+                                                              VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) == 0)
+                       throw tcu::NotSupportedError("Format not supported as attachment");
+
                const VkImageViewCreateInfo             createInfo      =
                {
                        VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,               // VkStructureType                      sType;