Use the correct SPIR-V capabilities in shader_viewport_index tests
If api version used is < 1.2 then te SPIR-V capability
ShaderViewportIndexLayerEXT must be used, otherwise the SPIR-V
capabilities shaderOutputLayer and shaderOutputViewportIndex must be
used
Components: Vulkan
VK-GL-CTS issue: 4458
Affected tests:
dEQP-VK.draw.renderpass.shader_viewport_index.*
Change-Id: Ieb2102049f2cc45733f3a1554e5d7753f6b6d0da
diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
index 5ecb994..ac25f10 100644
--- a/external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
+++ b/external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
@@ -463,6 +463,7 @@
<< "}\n";
programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+ programCollection.glslSources.add("vert_1_2") << glu::VertexSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_5, 0u, true);
}
// Fragment shader
@@ -502,6 +503,7 @@
<< "}\n";
programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+ programCollection.glslSources.add("vert_1_2") << glu::VertexSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_5, 0u, true);
}
// Fragment shader
@@ -543,6 +545,7 @@
<< "}\n";
programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+ programCollection.glslSources.add("vert_1_2") << glu::VertexSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_5, 0u, true);
}
// Tessellation control shader
@@ -596,6 +599,7 @@
<< "}\n";
programCollection.glslSources.add("tese") << glu::TessellationEvaluationSource(src.str());
+ programCollection.glslSources.add("tese_1_2") << glu::TessellationEvaluationSource(src.str()) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_5, 0u, true);
}
// Fragment shader
@@ -693,10 +697,10 @@
if (shader == TESSELLATION)
{
m_tessellationControlModule = createShaderModule (vk, device, context.getBinaryCollection().get("tesc"), 0u);
- m_tessellationEvaluationModule = createShaderModule (vk, device, context.getBinaryCollection().get("tese"), 0u);
+ m_tessellationEvaluationModule = createShaderModule (vk, device, context.getBinaryCollection().get(context.contextSupports(VK_API_VERSION_1_2) ? "tese_1_2" : "tese"), 0u);
}
- m_vertexModule = createShaderModule (vk, device, context.getBinaryCollection().get("vert"), 0u);
+ m_vertexModule = createShaderModule (vk, device, context.getBinaryCollection().get(context.contextSupports(VK_API_VERSION_1_2) ? "vert_1_2" : "vert"), 0u);
m_fragmentModule = createShaderModule (vk, device, context.getBinaryCollection().get("frag"), 0u);
if (!m_useDynamicRendering)