esextcTessellationShaderXFB: use individual out varyings instead of trying to get...
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 24 Nov 2016 17:17:35 +0000 (15:17 -0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Mon, 12 Dec 2016 09:59:30 +0000 (10:59 +0100)
Fixes:
GL45-CTS.tessellation_shader.single.xfb_captures_data_from_correct_stage

The test has a tessellation shader with a out varying like this:
          "out BLOCK_INOUT { vec4 value; } user_out[];\n"

The test uses transform feedback to get the content of user_out.

But the test is trying to use BLOCK_INOUT.value, instead of the
individual (4 in this case) elements of the array.

Additionally, this commit adds an OUT_PER_VERTEX_TCS_DECL, needed
as the out gl_PerVertex on tessellation control shaders is slightly
different compared with other stages.

From the GLSL 4.40 spec, page 123 (page 129 on the pdf):

   "In the tessellation control language, built-in variables are
    intrinsically declared as:

    <skip>
    out gl_PerVertex {
        vec4 gl_Position;
        float gl_PointSize;
        float gl_ClipDistance[];
    } gl_out[];"

Change-Id: I185aa456c4a802d71650b710d939bd749793942b

external/openglcts/modules/glesext/esextcTestCaseBase.cpp
external/openglcts/modules/glesext/tessellation_shader/esextcTessellationShaderXFB.cpp

index 1b3c26a..66c4826 100644 (file)
@@ -305,6 +305,7 @@ void TestCaseBase::initGLSLSpecializationMap()
                m_specializationMap["IN_PER_VERTEX_DECL_POINT_SIZE"]  = "\n";
                m_specializationMap["IN_DATA_DECL"]                                       = "\n";
                m_specializationMap["POSITION_WITH_IN_DATA"]              = "gl_Position = gl_in[0].gl_Position;\n";
+               m_specializationMap["OUT_PER_VERTEX_TCS_DECL"]            = "\n";
        }
        else
        {
@@ -319,7 +320,10 @@ void TestCaseBase::initGLSLSpecializationMap()
                m_specializationMap["IN_DATA_DECL"] = "in Data {\n"
                                                                                          "    vec4 pos;\n"
                                                                                          "} input_data[1];\n";
-               m_specializationMap["POSITION_WITH_IN_DATA"] = "gl_Position = input_data[0].pos;\n";
+               m_specializationMap["POSITION_WITH_IN_DATA"]   = "gl_Position = input_data[0].pos;\n";
+               m_specializationMap["OUT_PER_VERTEX_TCS_DECL"] = "out gl_PerVertex {\n"
+                                                                                                                "    vec4 gl_Position;\n"
+                                                                                                                "} gl_out[];\n";
        }
 }
 
index 09047e3..6f82f8f 100644 (file)
@@ -366,7 +366,7 @@ void TessellationShaderXFB::initTest()
                                                  "\n"
                                                  "precision highp float;\n"
                                                  "${IN_PER_VERTEX_DECL}"
-                                                 "${OUT_PER_VERTEX_DECL}"
+                                                 "${OUT_PER_VERTEX_TCS_DECL}"
                                                  "in  BLOCK_INOUT { vec4 value; } user_in[];\n"
                                                  "out BLOCK_INOUT { vec4 value; } user_out[];\n"
                                                  "\n"
@@ -400,9 +400,13 @@ void TessellationShaderXFB::initTest()
        {
                tc_feedback_valid = true;
        }
-       m_tc_program_id = createSeparableProgram(m_glExtTokens.TESS_CONTROL_SHADER, 1, /* n_strings */
-                                                                                        &tc_body, 1,                                              /* n_varyings */
-                                                                                        &varying_name, tc_feedback_valid);     /* should_succeed */
+
+       const glw::GLchar* tcs_varying_names[4] = { "BLOCK_INOUT[0].value", "BLOCK_INOUT[1].value", "BLOCK_INOUT[2].value",
+                                                                                               "BLOCK_INOUT[3].value" };
+
+       m_tc_program_id = createSeparableProgram(m_glExtTokens.TESS_CONTROL_SHADER, 1,  /* n_strings */
+                                                                                        &tc_body, 4,                                                   /* n_varyings */
+                                                                                        tcs_varying_names, tc_feedback_valid); /* should_succeed */
 
        if (glu::isContextTypeES(m_context.getRenderContext().getType()))
        {