Check for shaderFloat64 before creating shaders
authorAlex Walters <alex.walters@imgtec.com>
Tue, 20 Jun 2017 11:27:11 +0000 (12:27 +0100)
committerAlex Walters <alex.walters@imgtec.com>
Tue, 20 Jun 2017 12:32:31 +0000 (13:32 +0100)
Shader is using double types for F64 vertex attribute cases without
checking that the shader feature is supported.

The test was eventually making this check, but not until setting up
the vertex attributes themselves. This change also avoid creating some
other resources before determining that the test is unsupported.

Affects:

dEQP-VK.pipeline.vertex_input.single_attribute*64*

Components: Vulkan

VK-GL-CTS issue: 459

Change-Id: I6142af4e1a64aac233d6890285f81db327589800

external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp

index 4989839..9d8ca96 100644 (file)
@@ -650,6 +650,16 @@ VertexInputInstance::VertexInputInstance (Context&                                                                                         context,
        SimpleAllocator                         memAlloc                                (vk, vkDevice, getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice()));
        const VkComponentMapping        componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
 
+       // Check upfront for unsupported features
+       for (size_t attributeNdx = 0; attributeNdx < attributeDescriptions.size(); attributeNdx++)
+       {
+               const VkVertexInputAttributeDescription& attributeDescription = attributeDescriptions[attributeNdx].vkDescription;
+               if (!isSupportedVertexFormat(context, attributeDescription.format))
+               {
+                       throw tcu::NotSupportedError(std::string("Unsupported format for vertex input: ") + getFormatName(attributeDescription.format));
+               }
+       }
+
        // Create color image
        {
                const VkImageCreateInfo colorImageParams =
@@ -813,10 +823,6 @@ VertexInputInstance::VertexInputInstance (Context&                                                                                         context,
                for (size_t attributeNdx = 0; attributeNdx < attributeDescriptions.size(); attributeNdx++)
                {
                        const VkVertexInputAttributeDescription& attributeDescription = attributeDescriptions[attributeNdx].vkDescription;
-
-                       if (!isSupportedVertexFormat(context, attributeDescription.format))
-                               throw tcu::NotSupportedError(std::string("Unsupported format for vertex input: ") + getFormatName(attributeDescription.format));
-
                        vkAttributeDescriptions.push_back(attributeDescription);
                }