From: Piers Daniell Date: Wed, 15 Sep 2021 13:41:49 +0000 (+0200) Subject: Ensure the vertex shader matches the vertex input definition X-Git-Tag: upstream/1.3.5~332^2~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aebbea7b29507dfb24fb204697671ad7b4ac4fc1;p=platform%2Fupstream%2FVK-GL-CTS.git Ensure the vertex shader matches the vertex input definition When doing the "reversed" variants of the extended dynamic state tests, the vertex input attribute and binding information was reversed, but the vertex shaders were not. The meant that in some tests the vertex shader may try to fetch from unbound or undefined vertex attributes or vertex attribute data. This commit fixes the issue by swapping vertex shaders for the affected variants. Affects: dEQP-VK.pipeline.extended_dynamic_state.* Components: Vulkan VK-GL-CTS issue: 3111 Change-Id: I7d9abbe7dab0b44127f6b194ee5da79755f7658c Co-authored-by: Ricardo Garcia --- diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineExtendedDynamicStateTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineExtendedDynamicStateTests.cpp index d79463b..bdf8e07 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineExtendedDynamicStateTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineExtendedDynamicStateTests.cpp @@ -1432,9 +1432,11 @@ void ExtendedDynamicStateTest::initPrograms (vk::SourceCollections& programColle << "}\n"; } + // In reversed test configurations, the pipeline with dynamic state needs to have the inactive shader. + const auto kReversed = m_testConfig.isReversed(); + programCollection.glslSources.add("dynamicVert") << glu::VertexSource(kReversed ? inactiveVertSource : activeVertSource); + programCollection.glslSources.add("staticVert") << glu::VertexSource(kReversed ? activeVertSource : inactiveVertSource); - programCollection.glslSources.add("vert") << glu::VertexSource(activeVertSource); - programCollection.glslSources.add("vert2") << glu::VertexSource(inactiveVertSource); programCollection.glslSources.add("frag") << glu::FragmentSource(fragSource.str()); if (m_testConfig.needsGeometryShader()) programCollection.glslSources.add("geom") << glu::GeometrySource(geomSource.str()); @@ -1992,9 +1994,9 @@ tcu::TestStatus ExtendedDynamicStateInstance::iterate (void) } // Shader modules. - const auto vertModule = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert"), 0u); - const auto vertModule2 = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert2"), 0u); - const auto fragModule = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("frag"), 0u); + const auto dynamicVertModule = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("dynamicVert"), 0u); + const auto staticVertModule = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("staticVert"), 0u); + const auto fragModule = vk::createShaderModule(vkd, device, m_context.getBinaryCollection().get("frag"), 0u); vk::Move geomModule; vk::Move tescModule; vk::Move teseModule; @@ -2047,10 +2049,10 @@ tcu::TestStatus ExtendedDynamicStateInstance::iterate (void) shaderStaticStages = shaderStages; shaderStageCreateInfo.stage = vk::VK_SHADER_STAGE_VERTEX_BIT; - shaderStageCreateInfo.module = vertModule.get(); + shaderStageCreateInfo.module = dynamicVertModule.get(); shaderStages.push_back(shaderStageCreateInfo); - shaderStageCreateInfo.module = vertModule2.get(); + shaderStageCreateInfo.module = staticVertModule.get(); shaderStaticStages.push_back(shaderStageCreateInfo); // Input state.