pipeline/vktPipelineVertexInputTests: fixed attribute location for double formats
authorasokolow <aleksy.sokolowski@intel.com>
Tue, 12 Jan 2016 08:38:29 +0000 (09:38 +0100)
committerscygan <slawomir.cygan@intel.com>
Fri, 15 Jan 2016 15:29:30 +0000 (16:29 +0100)
external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp

index 666844c..a305639 100644 (file)
@@ -359,7 +359,15 @@ TestInstance* VertexInputTest::createInstance (Context& context) const
                        bindingDescriptions[attributeBinding].stride += inputSize;
                        attributeOffsets[attributeBinding] += inputSize;
 
-                       attributeLocation++;
+                       //double formats with more than 2 components will take 2 locations
+                       const GlslType type = attributeInfo.glslType;
+                       if ((type == GLSL_TYPE_DMAT2 || type == GLSL_TYPE_DMAT3 || type == GLSL_TYPE_DMAT4) &&
+                               (attributeInfo.vkType == VK_FORMAT_R64G64B64_SFLOAT || attributeInfo.vkType == VK_FORMAT_R64G64B64A64_SFLOAT))
+                       {
+                               attributeLocation += 2;
+                       }
+                       else
+                               attributeLocation++;
 
                        attributeDescriptions.push_back(attributeDescription);
                }