Fix triangle strip adjacency tests vertex ordering
authorziga-lunarg <ziga@lunarg.com>
Mon, 25 Jul 2022 15:14:31 +0000 (17:14 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 26 Aug 2022 14:36:39 +0000 (14:36 +0000)
OpenGL got an update where the ordering of vertices captured
by transform feedback when GL_TRIANGLE_STRIP_ADJACENCY is used
can either match the old OpenGL ordering or the new Vulkan ordering

Components: OpenGL

VK-GL-CTS issue: 3671

Affected tests:
KHR-GLES31.core.geometry_shader.*
KHR-GLES32.core.geometry_shader.*

Change-Id: I7f75b357593429110cc4517d0852b5cf2f7bb8db

external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAdjacency.cpp
external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAdjacency.hpp
external/openglcts/modules/glesext/geometry_shader/esextcGeometryShaderAdjacencyTests.cpp

index 9d38475..9b1d177 100644 (file)
@@ -96,6 +96,8 @@ AdjacencyTestData::AdjacencyTestData()
        , m_vertex_data_bo_size(0)
        , m_expected_adjacency_geometry(0)
        , m_expected_geometry(0)
+       , m_alternate_expected_adjacency_geometry(0)
+       , m_alternate_expected_geometry(0)
        , m_index_data(0)
        , m_tf_mode(0)
        , m_vertex_data(0)
@@ -120,6 +122,18 @@ AdjacencyTestData::~AdjacencyTestData()
                m_expected_geometry = 0;
        }
 
+       if (m_alternate_expected_adjacency_geometry)
+       {
+               delete[] m_alternate_expected_adjacency_geometry;
+               m_alternate_expected_adjacency_geometry = 0;
+       }
+
+       if (m_alternate_expected_geometry)
+       {
+               delete[] m_alternate_expected_geometry;
+               m_alternate_expected_geometry = 0;
+       }
+
        if (m_vertex_data)
        {
                delete[] m_vertex_data;
@@ -409,6 +423,11 @@ tcu::TestNode::IterateResult GeometryShaderAdjacency::iterate(void)
        float* result_adjacency_geometry_ptr = 0;
        float* result_geometry_ptr                       = 0;
 
+       bool hasAlternateData = m_test_data.m_alternate_expected_geometry != nullptr &&
+                                                       m_test_data.m_alternate_expected_adjacency_geometry != nullptr;
+       bool adjacentMatchesExpected              = true;
+       bool adjacentMatchesAlternateExpected = hasAlternateData;
+
        /* If gs is available read adjacency data using TF and compare with expected data*/
        if (m_test_data.m_gs_code)
        {
@@ -418,25 +437,61 @@ tcu::TestNode::IterateResult GeometryShaderAdjacency::iterate(void)
                GLU_EXPECT_NO_ERROR(gl.getError(), "Error when mapping data to client space");
 
                std::stringstream sstreamExpected;
+               std::stringstream sstreamAlternateExpected;
                std::stringstream sstreamResult;
                sstreamExpected << "[";
+               if (hasAlternateData)
+                       sstreamAlternateExpected << "[";
                sstreamResult << "[";
 
+               unsigned int differentExpectedIndex                      = 0;
+               unsigned int differentAlternateExpectedIndex = 0;
                for (unsigned int n = 0; n < m_test_data.m_geometry_bo_size / sizeof(float); ++n)
                {
                        sstreamExpected << m_test_data.m_expected_adjacency_geometry[n] << ", ";
+                       if (hasAlternateData)
+                               sstreamAlternateExpected << m_test_data.m_alternate_expected_adjacency_geometry[n] << ", ";
                        sstreamResult << result_adjacency_geometry_ptr[n] << ", ";
 
-                       if (de::abs(result_adjacency_geometry_ptr[n] - m_test_data.m_expected_adjacency_geometry[n]) >= m_epsilon)
+                       if (adjacentMatchesExpected &&
+                               de::abs(result_adjacency_geometry_ptr[n] -
+                                                                          m_test_data.m_expected_adjacency_geometry[n]) >= m_epsilon)
+                       {
+                               adjacentMatchesExpected = false;
+                               differentExpectedIndex = n;
+                       }
+                       if (adjacentMatchesAlternateExpected &&
+                               de::abs(result_adjacency_geometry_ptr[n] - m_test_data.m_alternate_expected_adjacency_geometry[n]) >=
+                                       m_epsilon)
+                       {
+                               adjacentMatchesAlternateExpected = false;
+                               differentAlternateExpectedIndex = n;
+                       }
+                       if (!adjacentMatchesExpected && !adjacentMatchesAlternateExpected)
                        {
                                gl.unmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER);
 
-                               m_testCtx.getLog() << tcu::TestLog::Message << "At [" << n
+                               m_testCtx.getLog() << tcu::TestLog::Message << "At [" << differentExpectedIndex
                                                                   << "] position adjacency buffer position Reference value is different than the "
                                                                          "rendered data (epsilon "
                                                                   << m_epsilon << " )"
-                                                                  << " (" << m_test_data.m_expected_adjacency_geometry[n] << ") vs "
-                                                                  << "(" << result_adjacency_geometry_ptr[n] << ")" << tcu::TestLog::EndMessage;
+                                                                  << " (" << m_test_data.m_expected_adjacency_geometry[differentExpectedIndex]
+                                                                  << ") vs "
+                                                                  << "(" << result_adjacency_geometry_ptr[differentExpectedIndex] << ")"
+                                                                  << tcu::TestLog::EndMessage;
+
+                               if (hasAlternateData)
+                               {
+                                       m_testCtx.getLog()
+                                               << tcu::TestLog::Message << "At [" << differentAlternateExpectedIndex
+                                               << "] alternate position adjacency buffer position Reference value is different than the "
+                                                  "rendered data (epsilon "
+                                               << m_epsilon << " )"
+                                               << " (" << m_test_data.m_alternate_expected_adjacency_geometry[differentAlternateExpectedIndex]
+                                               << ") vs "
+                                               << "(" << result_adjacency_geometry_ptr[differentAlternateExpectedIndex] << ")"
+                                               << tcu::TestLog::EndMessage;
+                               }
 
                                m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
                                return STOP;
@@ -444,9 +499,15 @@ tcu::TestNode::IterateResult GeometryShaderAdjacency::iterate(void)
                }
 
                sstreamExpected << "]";
+               if (hasAlternateData)
+                       sstreamAlternateExpected << "]";
                sstreamResult << "]";
                m_testCtx.getLog() << tcu::TestLog::Message << "Adjacency Expected: " << sstreamExpected.str().c_str()
                                                   << tcu::TestLog::EndMessage;
+               if (hasAlternateData)
+                       m_testCtx.getLog() << tcu::TestLog::Message
+                                                          << "Alternate adjacency Expected: " << sstreamAlternateExpected.str().c_str()
+                                                          << tcu::TestLog::EndMessage;
                m_testCtx.getLog() << tcu::TestLog::Message << "Adjacency Result:  " << sstreamResult.str().c_str()
                                                   << tcu::TestLog::EndMessage;
 
@@ -460,33 +521,93 @@ tcu::TestNode::IterateResult GeometryShaderAdjacency::iterate(void)
        GLU_EXPECT_NO_ERROR(gl.getError(), "Error when mapping data to client space");
 
        std::stringstream sstreamExpected;
+       std::stringstream sstreamAlternateExpected;
        std::stringstream sstreamResult;
        sstreamExpected << "[";
+       if (hasAlternateData)
+       {
+               sstreamAlternateExpected << "[";
+       }
        sstreamResult << "[";
 
+       bool             matchesExpected                  = true;
+       bool             matchesAlternateExpected = hasAlternateData;
+       unsigned int differentIndex                       = 0;
+       unsigned int differentAlternateIndex  = 0;
+
        for (unsigned int n = 0; n < m_test_data.m_geometry_bo_size / sizeof(float); ++n)
        {
                sstreamExpected << m_test_data.m_expected_geometry[n] << ", ";
+               if (hasAlternateData)
+               {
+                       sstreamAlternateExpected << m_test_data.m_alternate_expected_geometry[n] << ", ";
+               }
                sstreamResult << result_geometry_ptr[n] << ", ";
 
-               if (de::abs(result_geometry_ptr[n] - m_test_data.m_expected_geometry[n]) >= m_epsilon)
+               if (matchesExpected && de::abs(result_geometry_ptr[n] - m_test_data.m_expected_geometry[n]) >= m_epsilon)
+               {
+                       matchesExpected = false;
+                       differentIndex  = n;
+               }
+               if (matchesAlternateExpected &&
+                       de::abs(result_geometry_ptr[n] - m_test_data.m_alternate_expected_geometry[n]) >= m_epsilon)
+               {
+                       matchesAlternateExpected = false;
+                       differentAlternateIndex  = n;
+               }
+               if (!matchesExpected && !matchesAlternateExpected)
                {
                        gl.unmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER);
 
                        m_testCtx.getLog()
-                               << tcu::TestLog::Message << "At [" << n
+                               << tcu::TestLog::Message << "At [" << differentIndex
                                << "] position geometry buffer position Reference value is different than the rendered data (epsilon "
                                << m_epsilon << " )"
-                               << " (" << m_test_data.m_expected_geometry[n] << ") vs "
-                               << "(" << result_geometry_ptr[n] << ")" << tcu::TestLog::EndMessage;
+                               << " (" << m_test_data.m_expected_geometry[differentIndex] << ") vs "
+                               << "(" << result_geometry_ptr[differentIndex] << ")" << tcu::TestLog::EndMessage;
+
+                       if (hasAlternateData)
+                       {
+                               m_testCtx.getLog()
+                                       << tcu::TestLog::Message << "At [" << differentAlternateIndex
+                                       << "] alternate position geometry buffer position Reference value is different than the rendered data (epsilon "
+                                       << m_epsilon << " )"
+                                       << " (" << m_test_data.m_alternate_expected_geometry[differentAlternateIndex] << ") vs "
+                                       << "(" << result_geometry_ptr[differentAlternateIndex] << ")" << tcu::TestLog::EndMessage;
+                       }
 
                        m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
                        return STOP;
                }
        }
 
+       if (matchesExpected && !adjacentMatchesExpected)
+       {
+               m_testCtx.getLog() << tcu::TestLog::Message
+                                                  << "Geometry matches OpenGL ordering but adjacent geometry matches Vulkan ordering"
+                                                  << tcu::TestLog::EndMessage;
+
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               return STOP;
+       }
+       if (matchesAlternateExpected && !adjacentMatchesAlternateExpected)
+       {
+               m_testCtx.getLog() << tcu::TestLog::Message
+                                                  << "Geometry matches Vulkan ordering but adjacent geometry matches OpenGL ordering"
+                                                  << tcu::TestLog::EndMessage;
+
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               return STOP;
+       }
+
        sstreamExpected << "]";
        sstreamResult << "]";
+       if (hasAlternateData)
+       {
+               sstreamAlternateExpected << "]";
+
+               sstreamExpected << "\nor\n" << sstreamAlternateExpected.str();
+       }
        m_testCtx.getLog() << tcu::TestLog::Message << "Expected: " << sstreamExpected.str().c_str()
                                           << tcu::TestLog::EndMessage;
        m_testCtx.getLog() << tcu::TestLog::Message << "Result:  " << sstreamResult.str().c_str()
index 3fc4ad7..67f0ef8 100644 (file)
@@ -283,6 +283,8 @@ public:
        glw::GLuint     m_vertex_data_bo_size;
        glw::GLfloat*  m_expected_adjacency_geometry;
        glw::GLfloat*  m_expected_geometry;
+       glw::GLfloat*  m_alternate_expected_adjacency_geometry;
+       glw::GLfloat*  m_alternate_expected_geometry;
        glw::GLuint*   m_index_data;
        glw::GLenum     m_tf_mode;
        glw::GLfloat*  m_vertex_data;
index 7275784..584fb8f 100644 (file)
@@ -1237,12 +1237,12 @@ void GeometryShaderAdjacencyTests::setTriangleStripPointsNonindiced(AdjacencyTes
                static_cast<glw::GLuint>(test_data.m_n_vertices * m_n_components_input * sizeof(float));
 
        /* Allocate memory for input and expected data */
-       test_data.m_expected_adjacency_geometry = new float[test_data.m_geometry_bo_size / sizeof(float)];
-       test_data.m_expected_geometry                   = new float[test_data.m_geometry_bo_size / sizeof(float)];
-       test_data.m_vertex_data                                 = new float[test_data.m_vertex_data_bo_size / sizeof(float)];
+       test_data.m_expected_adjacency_geometry           = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_expected_geometry                             = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_alternate_expected_adjacency_geometry = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_alternate_expected_geometry                   = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_vertex_data                                           = new float[test_data.m_vertex_data_bo_size / sizeof(float)];
 
-       travellerExpectedAdjacencyGeometryPtr = test_data.m_expected_adjacency_geometry;
-       travellerExpectedGeometryPtr              = test_data.m_expected_geometry;
        travellerPtr                                              = test_data.m_vertex_data;
 
        /* Set input and expected values */
@@ -1254,127 +1254,165 @@ void GeometryShaderAdjacencyTests::setTriangleStripPointsNonindiced(AdjacencyTes
                ++travellerPtr;
        }
 
-       for (unsigned int n = 0; n < nTriangles; ++n)
+       for (unsigned int j = 0; j < 2; ++j)
        {
-               /* Derived from per table 2.X1 from the spec */
-               int vertexIndex[3]      = { -1, -1, -1 };
-               int adjVertexIndex[3] = { -1, -1, -1 };
-
-               if (n == 0)
+               if (j == 0)
                {
-                       /* first (i==0) */
-                       adjVertexIndex[0] = 2;
-                       adjVertexIndex[1] = 7;
-                       adjVertexIndex[2] = 4;
-                       vertexIndex[0]  = 1;
-                       vertexIndex[1]  = 3;
-                       vertexIndex[2]  = 5;
+                       travellerExpectedAdjacencyGeometryPtr = test_data.m_expected_adjacency_geometry;
+                       travellerExpectedGeometryPtr              = test_data.m_expected_geometry;
                }
-               else if (n == nTriangles - 1)
+               else
                {
-                       if (n % 2 == 0)
-                       {
-                               /* last (i==n-1, i even) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 6;
-                               adjVertexIndex[2] = 2 * n + 4;
-                               vertexIndex[0]  = 2 * n + 1;
-                               vertexIndex[1]  = 2 * n + 3;
-                               vertexIndex[2]  = 2 * n + 5;
-                       }
-                       else
-                       {
-                               /* last (i==n-1, i odd) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 4;
-                               adjVertexIndex[2] = 2 * n + 6;
-                               vertexIndex[0]  = 2 * n + 3;
-                               vertexIndex[1]  = 2 * n + 1;
-                               vertexIndex[2]  = 2 * n + 5;
-                       }
+                       travellerExpectedAdjacencyGeometryPtr = test_data.m_alternate_expected_adjacency_geometry;
+                       travellerExpectedGeometryPtr              = test_data.m_alternate_expected_geometry;
                }
-               else
+               for (unsigned int n = 0; n < nTriangles; ++n)
                {
-                       if (n % 2 == 0)
+                       /* Derived from per table 2.X1 from the spec */
+                       int vertexIndex[3]                              = { -1, -1, -1 };
+                       int adjVertexIndex[3]                   = { -1, -1, -1 };
+
+                       if (n == 0)
+                       {
+                               /* first (i==0) */
+                               adjVertexIndex[0] = 2;
+                               adjVertexIndex[1] = 7;
+                               adjVertexIndex[2] = 4;
+                               vertexIndex[0]  = 1;
+                               vertexIndex[1]  = 3;
+                               vertexIndex[2]  = 5;
+                       }
+                       else if (n == nTriangles - 1)
                        {
-                               /* middle (i even) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 7;
-                               adjVertexIndex[2] = 2 * n + 4;
-                               vertexIndex[0]  = 2 * n + 1;
-                               vertexIndex[1]  = 2 * n + 3;
-                               vertexIndex[2]  = 2 * n + 5;
+                               if (n % 2 == 0)
+                               {
+                                       /* last (i==n-1, i even) */
+                                       adjVertexIndex[0] = 2 * n - 1;
+                                       adjVertexIndex[1] = 2 * n + 6;
+                                       adjVertexIndex[2] = 2 * n + 4;
+                                       vertexIndex[0]  = 2 * n + 1;
+                                       vertexIndex[1]  = 2 * n + 3;
+                                       vertexIndex[2]  = 2 * n + 5;
+                               }
+                               else
+                               {
+                                       /* last (i==n-1, i odd) */
+                                       if (j == 0)
+                                       {
+                                               adjVertexIndex[0] = 2 * n - 1;
+                                               adjVertexIndex[1] = 2 * n + 4;
+                                               adjVertexIndex[2] = 2 * n + 6;
+                                               vertexIndex[0]    = 2 * n + 3;
+                                               vertexIndex[1]    = 2 * n + 1;
+                                               vertexIndex[2]    = 2 * n + 5;
+                                       }
+                                       else
+                                       {
+                                               adjVertexIndex[0] = 2 * n + 4;
+                                               adjVertexIndex[1] = 2 * n + 6;
+                                               adjVertexIndex[2] = 2 * n - 1;
+                                               vertexIndex[0]    = 2 * n + 1;
+                                               vertexIndex[1]    = 2 * n + 5;
+                                               vertexIndex[2]    = 2 * n + 3;
+                                       }
+                               }
                        }
                        else
                        {
-                               /* middle (i odd) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 4;
-                               adjVertexIndex[2] = 2 * n + 7;
-                               vertexIndex[0]  = 2 * n + 3;
-                               vertexIndex[1]  = 2 * n + 1;
-                               vertexIndex[2]  = 2 * n + 5;
+                               if (n % 2 == 0)
+                               {
+                                       /* middle (i even) */
+                                       adjVertexIndex[0] = 2 * n - 1;
+                                       adjVertexIndex[1] = 2 * n + 7;
+                                       adjVertexIndex[2] = 2 * n + 4;
+                                       vertexIndex[0]  = 2 * n + 1;
+                                       vertexIndex[1]  = 2 * n + 3;
+                                       vertexIndex[2]  = 2 * n + 5;
+                               }
+                               else
+                               {
+                                       /* middle (i odd) */
+                                       if (j == 0)
+                                       {
+
+                                               adjVertexIndex[0] = 2 * n - 1;
+                                               adjVertexIndex[1] = 2 * n + 4;
+                                               adjVertexIndex[2] = 2 * n + 7;
+                                               vertexIndex[0]    = 2 * n + 3;
+                                               vertexIndex[1]    = 2 * n + 1;
+                                               vertexIndex[2]    = 2 * n + 5;
+                                       }
+                                       else
+                                       {
+                                               adjVertexIndex[0] = 2 * n + 4;
+                                               adjVertexIndex[1] = 2 * n + 7;
+                                               adjVertexIndex[2] = 2 * n - 1;
+                                               vertexIndex[0]    = 2 * n + 1;
+                                               vertexIndex[1]    = 2 * n + 5;
+                                               vertexIndex[2]    = 2 * n + 3;
+                                       }
+                               }
                        }
-               }
 
-               /* Spec assumes vertices are indexed from 1 */
-               vertexIndex[0]--;
-               vertexIndex[1]--;
-               vertexIndex[2]--;
-               adjVertexIndex[0]--;
-               adjVertexIndex[1]--;
-               adjVertexIndex[2]--;
-
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[0]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[0]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[1]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[1]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[2]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[2]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[0]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[0]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[1]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[1]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[2]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[2]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-       } /* for (all triangles) */
+                       /* Spec assumes vertices are indexed from 1 */
+                       vertexIndex[0]--;
+                       vertexIndex[1]--;
+                       vertexIndex[2]--;
+                       adjVertexIndex[0]--;
+                       adjVertexIndex[1]--;
+                       adjVertexIndex[2]--;
+
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[0]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[0]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[1]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[1]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[2]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[adjVertexIndex[2]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[0]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[0]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[1]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[1]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[2]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = test_data.m_grid->m_triangle_strip.m_points[vertexIndex[2]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+               } /* for (all triangles) */
+       }
 }
 
 /** Set triangle strip vertex data used to be used by indiced draw calls.
@@ -1399,13 +1437,13 @@ void GeometryShaderAdjacencyTests::setTriangleStripPointsIndiced(AdjacencyTestDa
        test_data.m_index_data_bo_size = static_cast<glw::GLuint>(test_data.m_n_vertices * sizeof(unsigned int));
 
        /* Allocate memory for input and expected data */
-       test_data.m_expected_adjacency_geometry = new float[test_data.m_geometry_bo_size / sizeof(float)];
-       test_data.m_expected_geometry                   = new float[test_data.m_geometry_bo_size / sizeof(float)];
-       test_data.m_index_data                                  = new unsigned int[test_data.m_index_data_bo_size / sizeof(unsigned int)];
-       test_data.m_vertex_data                                 = new float[test_data.m_vertex_data_bo_size / sizeof(float)];
+       test_data.m_expected_adjacency_geometry           = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_expected_geometry                             = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_alternate_expected_adjacency_geometry = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_alternate_expected_geometry                   = new float[test_data.m_geometry_bo_size / sizeof(float)];
+       test_data.m_index_data                                            = new unsigned int[test_data.m_index_data_bo_size / sizeof(unsigned int)];
+       test_data.m_vertex_data                                           = new float[test_data.m_vertex_data_bo_size / sizeof(float)];
 
-       travellerExpectedAdjacencyGeometryPtr = test_data.m_expected_adjacency_geometry;
-       travellerExpectedGeometryPtr              = test_data.m_expected_geometry;
        travellerIndicesPtr                                       = test_data.m_index_data;
        travellerPtr                                              = test_data.m_vertex_data;
 
@@ -1424,138 +1462,176 @@ void GeometryShaderAdjacencyTests::setTriangleStripPointsIndiced(AdjacencyTestDa
                ++travellerPtr;
        }
 
-       for (unsigned int n = 0; n < nTriangles; ++n)
+       for (unsigned int j = 0; j < 2; ++j)
        {
-               /* Derived from per table 2.X1 from the spec */
-               int vertexIndex[3]      = { -1, -1, -1 };
-               int adjVertexIndex[3] = { -1, -1, -1 };
-
-               if (n == 0)
+               if (j == 0)
                {
-                       /* first (i==0) */
-                       adjVertexIndex[0] = 2;
-                       adjVertexIndex[1] = 7;
-                       adjVertexIndex[2] = 4;
-                       vertexIndex[0]  = 1;
-                       vertexIndex[1]  = 3;
-                       vertexIndex[2]  = 5;
+                       travellerExpectedAdjacencyGeometryPtr = test_data.m_expected_adjacency_geometry;
+                       travellerExpectedGeometryPtr              = test_data.m_expected_geometry;
                }
-               else if (n == nTriangles - 1)
+               else
                {
-                       if (n % 2 == 0)
-                       {
-                               /* last (i==n-1, i even) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 6;
-                               adjVertexIndex[2] = 2 * n + 4;
-                               vertexIndex[0]  = 2 * n + 1;
-                               vertexIndex[1]  = 2 * n + 3;
-                               vertexIndex[2]  = 2 * n + 5;
-                       }
-                       else
-                       {
-                               /* last (i==n-1, i odd) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 4;
-                               adjVertexIndex[2] = 2 * n + 6;
-                               vertexIndex[0]  = 2 * n + 3;
-                               vertexIndex[1]  = 2 * n + 1;
-                               vertexIndex[2]  = 2 * n + 5;
-                       }
+                       travellerExpectedAdjacencyGeometryPtr = test_data.m_alternate_expected_adjacency_geometry;
+                       travellerExpectedGeometryPtr              = test_data.m_alternate_expected_geometry;
                }
-               else
+
+               for (unsigned int n = 0; n < nTriangles; ++n)
                {
-                       if (n % 2 == 0)
+                       /* Derived from per table 2.X1 from the spec */
+                       int vertexIndex[3]      = { -1, -1, -1 };
+                       int adjVertexIndex[3] = { -1, -1, -1 };
+
+                       if (n == 0)
+                       {
+                               /* first (i==0) */
+                               adjVertexIndex[0] = 2;
+                               adjVertexIndex[1] = 7;
+                               adjVertexIndex[2] = 4;
+                               vertexIndex[0]  = 1;
+                               vertexIndex[1]  = 3;
+                               vertexIndex[2]  = 5;
+                       }
+                       else if (n == nTriangles - 1)
                        {
-                               /* middle (i even) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 7;
-                               adjVertexIndex[2] = 2 * n + 4;
-                               vertexIndex[0]  = 2 * n + 1;
-                               vertexIndex[1]  = 2 * n + 3;
-                               vertexIndex[2]  = 2 * n + 5;
+                               if (n % 2 == 0)
+                               {
+                                       /* last (i==n-1, i even) */
+                                       adjVertexIndex[0] = 2 * n - 1;
+                                       adjVertexIndex[1] = 2 * n + 6;
+                                       adjVertexIndex[2] = 2 * n + 4;
+                                       vertexIndex[0]  = 2 * n + 1;
+                                       vertexIndex[1]  = 2 * n + 3;
+                                       vertexIndex[2]  = 2 * n + 5;
+                               }
+                               else
+                               {
+                                       /* last (i==n-1, i odd) */
+                                       if (j == 0)
+                                       {
+                                               adjVertexIndex[0] = 2 * n - 1;
+                                               adjVertexIndex[1] = 2 * n + 4;
+                                               adjVertexIndex[2] = 2 * n + 6;
+                                               vertexIndex[0]    = 2 * n + 3;
+                                               vertexIndex[1]    = 2 * n + 1;
+                                               vertexIndex[2]    = 2 * n + 5;
+                                       }
+                                       else
+                                       {
+                                               adjVertexIndex[0] = 2 * n + 4;
+                                               adjVertexIndex[1] = 2 * n + 6;
+                                               adjVertexIndex[2] = 2 * n - 1;
+                                               vertexIndex[0]    = 2 * n + 1;
+                                               vertexIndex[1]    = 2 * n + 5;
+                                               vertexIndex[2]    = 2 * n + 3;
+                                       }
+                               }
                        }
                        else
                        {
-                               /* middle (i odd) */
-                               adjVertexIndex[0] = 2 * n - 1;
-                               adjVertexIndex[1] = 2 * n + 4;
-                               adjVertexIndex[2] = 2 * n + 7;
-                               vertexIndex[0]  = 2 * n + 3;
-                               vertexIndex[1]  = 2 * n + 1;
-                               vertexIndex[2]  = 2 * n + 5;
+                               if (n % 2 == 0)
+                               {
+                                       /* middle (i even) */
+                                       adjVertexIndex[0] = 2 * n - 1;
+                                       adjVertexIndex[1] = 2 * n + 7;
+                                       adjVertexIndex[2] = 2 * n + 4;
+                                       vertexIndex[0]  = 2 * n + 1;
+                                       vertexIndex[1]  = 2 * n + 3;
+                                       vertexIndex[2]  = 2 * n + 5;
+                               }
+                               else
+                               {
+                                       /* middle (i odd) */
+                                       if (j == 0)
+                                       {
+                                               adjVertexIndex[0] = 2 * n - 1;
+                                               adjVertexIndex[1] = 2 * n + 4;
+                                               adjVertexIndex[2] = 2 * n + 7;
+                                               vertexIndex[0]    = 2 * n + 3;
+                                               vertexIndex[1]    = 2 * n + 1;
+                                               vertexIndex[2]    = 2 * n + 5;
+                                       }
+                                       else
+                                       {
+                                               adjVertexIndex[0] = 2 * n + 4;
+                                               adjVertexIndex[1] = 2 * n + 7;
+                                               adjVertexIndex[2] = 2 * n - 1;
+                                               vertexIndex[0]    = 2 * n + 1;
+                                               vertexIndex[1]    = 2 * n + 5;
+                                               vertexIndex[2]    = 2 * n + 3;
+                                       }
+                               }
                        }
-               }
-
-               /* Spec assumes vertices are indexed from 1 */
-               vertexIndex[0]--;
-               vertexIndex[1]--;
-               vertexIndex[2]--;
-               adjVertexIndex[0]--;
-               adjVertexIndex[1]--;
-               adjVertexIndex[2]--;
 
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[0]]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[0]]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[1]]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[1]]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[2]]].x;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[2]]].y;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 0;
-               ++travellerExpectedAdjacencyGeometryPtr;
-               *travellerExpectedAdjacencyGeometryPtr = 1;
-               ++travellerExpectedAdjacencyGeometryPtr;
-
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[0]]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[0]]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[1]]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[1]]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[2]]].x;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr =
-                       test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[2]]].y;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 0;
-               ++travellerExpectedGeometryPtr;
-               *travellerExpectedGeometryPtr = 1;
-               ++travellerExpectedGeometryPtr;
-       } /* for (all triangles) */
+                       /* Spec assumes vertices are indexed from 1 */
+                       vertexIndex[0]--;
+                       vertexIndex[1]--;
+                       vertexIndex[2]--;
+                       adjVertexIndex[0]--;
+                       adjVertexIndex[1]--;
+                       adjVertexIndex[2]--;
+
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[0]]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[0]]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[1]]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[1]]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[2]]].x;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[adjVertexIndex[2]]].y;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 0;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+                       *travellerExpectedAdjacencyGeometryPtr = 1;
+                       ++travellerExpectedAdjacencyGeometryPtr;
+
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[0]]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[0]]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[1]]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[1]]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[2]]].x;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr =
+                               test_data.m_grid->m_triangle_strip.m_points[test_data.m_index_data[vertexIndex[2]]].y;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 0;
+                       ++travellerExpectedGeometryPtr;
+                       *travellerExpectedGeometryPtr = 1;
+                       ++travellerExpectedGeometryPtr;
+               } /* for (all triangles) */
+       }
 }
 }