+* @param context Rendering context
+*/
+ShaderGroupVoteWithVariablesTestCase::ShaderGroupVoteWithVariablesTestCase(deqp::Context& context,
+ ExtParameters& extParam)
+ : ShaderGroupVoteTestCaseBase(context, extParam, "invocations_with_variables", "Implements ...")
+{
+ const char* shaderBase = "${VERSION}\n"
+ "${GROUP_VOTE_EXTENSION}\n"
+ "layout(rgba8, binding = 2) writeonly uniform highp image2D destImage;\n"
+ "layout(local_size_x = ${SIZE_X}, local_size_y = ${SIZE_Y}) in;\n"
+ "void main (void)\n"
+ "{\n"
+ " bool result = ${EXPRESSION};\n"
+ " vec4 outColor = vec4(vec3(result ? 1.0 : 0.0), 1.0);\n"
+ " imageStore(destImage, ivec2(gl_GlobalInvocationID.xy), outColor);\n"
+ "}\n";
+
+ // first specialization EXPRESSION and then whole shader
+ const char* expression1 = "allInvocations${EXT_TYPE}((gl_LocalInvocationIndex % 2u) == 1u) && "
+ "anyInvocation${EXT_TYPE}((gl_LocalInvocationIndex % 2u) == 0u) && "
+ "anyInvocation${EXT_TYPE}((gl_LocalInvocationIndex % 2u) == 1u)";
+ m_specializationMap["EXPRESSION"] = specializeShader(1, &expression1);
+ m_shaders.push_back(
+ new ComputeShader("allInvocations", specializeShader(1, &shaderBase), tcu::IVec4(0, 0, 0, 255)));
+
+ const char* expression2 = "anyInvocation${EXT_TYPE}(gl_LocalInvocationIndex < 256u)";
+ m_specializationMap["EXPRESSION"] = specializeShader(1, &expression2);
+ m_shaders.push_back(
+ new ComputeShader("anyInvocation", specializeShader(1, &shaderBase), tcu::IVec4(255, 255, 255, 255)));
+
+ const char* expression3 = "allInvocationsEqual${EXT_TYPE}(gl_WorkGroupID.x == 0u)";
+ m_specializationMap["EXPRESSION"] = specializeShader(1, &expression3);
+ m_shaders.push_back(
+ new ComputeShader("anyInvocation", specializeShader(1, &shaderBase), tcu::IVec4(255, 255, 255, 255)));
+}
+
+/** Constructor.
+*