*
* @return Last location index
**/
-GLint TestBase::getLastInputLocation(Utils::Shader::STAGES stage, const Utils::Type& type, GLuint array_length)
+GLint TestBase::getLastInputLocation(Utils::Shader::STAGES stage, const Utils::Type& type, GLuint array_length, bool ignore_prev_stage)
{
GLint divide = 4; /* 4 components per location */
GLint param = 0;
gl.getIntegerv(pname, ¶m);
GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
- if (pnamePrev) {
+ if (pnamePrev && !ignore_prev_stage) {
gl.getIntegerv(pnamePrev, ¶mPrev);
GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
*
* @return Last location index
**/
-GLint TestBase::getLastOutputLocation(Utils::Shader::STAGES stage, const Utils::Type& type, GLuint array_length)
+GLint TestBase::getLastOutputLocation(Utils::Shader::STAGES stage, const Utils::Type& type, GLuint array_length, bool ignore_next_stage)
{
GLint param = 0;
GLenum pname = 0;
gl.getIntegerv(pname, ¶m);
GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
- gl.getIntegerv(pnameNext, ¶mNext);
- GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
-
/* Calculate */
#if WRKARD_VARYINGLOCATIONSTEST
#else
/* Don't write to a location that doesn't exist in the next stage */
- param = de::min(param, paramNext);
+ if (!ignore_next_stage)
+ {
+ gl.getIntegerv(pnameNext, ¶mNext);
+ GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
+
+ param = de::min(param, paramNext);
+ }
const GLint n_avl_locations = param / 4; /* 4 components per location */
const GLuint array_length = 1;
const GLuint first_in_loc = 0;
const GLuint first_out_loc = 0;
- const GLuint last_in_loc = getLastInputLocation(stage, type, array_length);
+ const GLuint last_in_loc = getLastInputLocation(stage, type, array_length, false);
size_t position = 0;
const GLchar* prefix_in = Utils::ProgramInterface::GetStagePrefix(stage, Utils::Variable::VARYING_INPUT);
if (Utils::Shader::FRAGMENT != stage)
{
- const GLuint last_out_loc = getLastOutputLocation(stage, type, array_length);
+ const GLuint last_out_loc = getLastOutputLocation(stage, type, array_length, false);
Utils::Variable* first_out =
si.Output(first_out_name.c_str(), qual_first_out /* qualifiers */, 0 /* expected_componenet */,
const GLuint array_length = 1u;
const GLuint first_in_loc = 0;
const GLuint first_out_loc = 0;
- const GLuint last_in_loc = getLastInputLocation(stage, type, array_length);
+ const GLuint last_in_loc = getLastInputLocation(stage, type, array_length, false);
size_t position = 0;
const GLchar* prefix_in = Utils::ProgramInterface::GetStagePrefix(stage, Utils::Variable::VARYING_INPUT);
if (Utils::Shader::FRAGMENT != stage)
{
- const GLuint last_out_loc = getLastOutputLocation(stage, type, array_length);
+ const GLuint last_out_loc = getLastOutputLocation(stage, type, array_length, false);
Utils::Variable* first_out =
si.Output(first_out_name.c_str(), qual_first_out /* qualifiers */, 0 /* expected_componenet */,
const GLchar* direction = "in ";
const GLchar* flat = "";
const GLchar* index = "";
- GLuint last = getLastInputLocation(stage, test_case.m_type, 0);
+ 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();
if (false == test_case.m_is_input)
{
direction = "out";
- last = getLastOutputLocation(stage, test_case.m_type, 0);
+ last = getLastOutputLocation(stage, test_case.m_type, 0, true);
storage = Utils::Variable::VARYING_OUTPUT;
var_use = output_use;
}
const GLuint first_in_loc = 0;
const GLuint first_out_loc = 0;
const GLchar* interpolation = "";
- const GLuint last_in_loc = getLastInputLocation(stage, vector_type, array_length);
+ const GLuint last_in_loc = getLastInputLocation(stage, vector_type, array_length, false);
GLuint last_out_loc = 0;
GLuint n_desc = 0;
Utils::ShaderInterface& si = program_interface.GetShaderInterface(stage);
if (Utils::Shader::FRAGMENT != stage)
{
- last_out_loc = getLastOutputLocation(stage, vector_type, array_length);
+ last_out_loc = getLastOutputLocation(stage, vector_type, array_length, false);
}
switch (test_case.m_layout)