" layout (location = 4) vec4 goten;\n"
#endif /* DEBUG_NEG_REMOVE_ERROR */
"};\n";
- static const GLchar* input_var = "in Data data;\n";
- static const GLchar* output_var = "out Data data;\n";
static const GLchar* input_use = " result += data.gohan + data.goten;\n";
- static const GLchar* output_use = " data.gohan = result / 2;\n"
- " data.goten = result / 4 - data.gohan;\n";
+ static const GLchar* input_var = "in Data dataARRAY;\n";
+ static const GLchar* output_var = "out Data dataARRAY;\n";
+ static const GLchar* output_use = " dataINDEX.gohan = result / 2;\n"
+ " dataINDEX.goten = result / 4 - dataINDEX.gohan;\n";
static const GLchar* fs = "#version 430 core\n"
"#extension GL_ARB_enhanced_layouts : require\n"
"\n"
testCase& test_case = m_test_cases[test_case_index];
const GLchar* var_definition = input_var;
const GLchar* var_use = Utils::Shader::VERTEX == test_case.m_stage ? input_use : "\n";
+ const GLchar* array = "";
+ const GLchar* index = "";
if (!test_case.m_is_input)
{
if (test_case.m_stage == stage)
{
size_t position = 0;
+ size_t temp = 0;
switch (stage)
{
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
+ array = "[]";
+ index = "[gl_InvocationID]";
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
}
Utils::replaceToken("STRUCT_DEFINITION", position, struct_definition, source);
+ temp = position;
Utils::replaceToken("VARIABLE_DEFINITION", position, var_definition, source);
+ position = temp;
+ Utils::replaceToken("ARRAY", position, array, source);
Utils::replaceToken("VARIABLE_USE", position, var_use, source);
+
+ Utils::replaceAllTokens("INDEX", index, source);
}
else
{
if (test_case.m_stage == stage)
{
size_t position = 0;
- size_t temp;
switch (stage)
{
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("BLOCK_DEFINITION", position, block_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("DIRECTION", position, direction, source);
Utils::replaceToken("ARRAY", position, array, source);
Utils::replaceToken("VARIABLE_USE", position, var_use, source);
const GLchar* index = "";
GLuint last = getLastInputLocation(stage, test_case.m_type, 0, true);
size_t position = 0;
- size_t temp;
const GLchar* type_name = test_case.m_type.GetGLSLTypeName();
Utils::Variable::STORAGE storage = Utils::Variable::VARYING_INPUT;
const GLchar* var_use = input_use;
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("LAST", position, buffer, source);
Utils::replaceToken("FLAT", position, flat, source);
Utils::replaceToken("DIRECTION", position, direction, source);
const GLchar* direction = "in";
const GLchar* index = "";
size_t position = 0;
- size_t temp;
const GLchar* type_name = test_case.m_type.GetGLSLTypeName();
const GLchar* var_use = 0;
Utils::Variable::STORAGE storage = Utils::Variable::VARYING_INPUT;
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer, source);
Utils::replaceToken("FLAT", position, flat, source);
Utils::replaceToken("DIRECTION", position, direction, source);
const GLchar* direction = "in";
const GLchar* index = "";
size_t position = 0;
- size_t temp;
const GLchar* type_name = test_case.m_type.GetGLSLTypeName();
const GLchar* var_use = Utils::Shader::VERTEX == stage ? input_use : "\n";
Utils::Variable::STORAGE storage = Utils::Variable::VARYING_INPUT;
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer, source);
Utils::replaceToken("FLAT", position, flat, source);
Utils::replaceToken("DIRECTION", position, direction, source);
const GLchar* direction = "in ";
const GLchar* index = "";
size_t position = 0;
- size_t temp;
const GLchar* type_name = test_case.m_type.GetGLSLTypeName();
const GLchar* var_use = 0;
Utils::Variable::STORAGE storage = Utils::Variable::VARYING_INPUT;
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer, source);
Utils::replaceToken("DIRECTION", position, direction, source);
Utils::replaceToken("ARRAY", position, array, source);
const GLchar* flat = "";
const GLchar* index = "";
size_t position = 0;
- size_t temp;
const GLchar* type_name = test_case.m_type.GetGLSLTypeName();
if (isFlatRequired(stage, test_case.m_type, Utils::Variable::VARYING_OUTPUT))
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer_gohan, source);
Utils::replaceToken("FLAT", position, flat, source);
Utils::replaceToken("ARRAY", position, array, source);
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer_gohan, source);
Utils::replaceToken("FLAT", position, flat_gohan, source);
Utils::replaceToken("DIRECTION", position, direction, source);
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array = "[]";
- index = "[0]";
+ array = test_case.m_is_input ? "[]" : "";
+ index = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::VERTEX:
source = vs_tested;
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer_gohan, source);
Utils::replaceToken("INTERPOLATION", position, int_gohan, source);
Utils::replaceToken("DIRECTION", position, direction, source);
break;
case Utils::Shader::GEOMETRY:
source = gs_tested;
- array_gohan = "[]";
- index_gohan = "[0]";
- array_goten = "[]";
- index_goten = "[0]";
+ array_gohan = test_case.m_is_input ? "[]" : "";
+ index_gohan = test_case.m_is_input ? "[0]" : "";
+ array_goten = test_case.m_is_input ? "[]" : "";
+ index_goten = test_case.m_is_input ? "[0]" : "";
break;
case Utils::Shader::TESS_CTRL:
source = tcs_tested;
break;
case Utils::Shader::TESS_EVAL:
source = tes_tested;
- array_gohan = "[]";
- index_gohan = "[0]";
+ array_gohan = test_case.m_is_input ? "[]" : "";
+ index_gohan = test_case.m_is_input ? "[0]" : "";
#if DEBUG_NEG_REMOVE_ERROR
array_goten = array_gohan;
index_goten = index_gohan;
#else
- array_goten = "[]";
- index_goten = "[0]";
+ array_goten = test_case.m_is_input ? "[]" : "";
+ index_goten = test_case.m_is_input ? "[0]" : "";
#endif /* DEBUG_NEG_REMOVE_ERROR */
break;
case Utils::Shader::VERTEX:
TCU_FAIL("Invalid enum");
}
- temp = position;
Utils::replaceToken("VAR_DEFINITION", position, var_definition, source);
- position = temp;
+ position = 0;
Utils::replaceToken("COMPONENT", position, buffer_gohan, source);
Utils::replaceToken("AUX", position, aux_gohan, source);
Utils::replaceToken("INTERPOLATION", position, int_gohan, source);