Do not expect TCS shader with XFB variables to fail linkging in GL
authorasokolow <aleksy.sokolowski@intel.com>
Tue, 12 Jun 2018 08:59:10 +0000 (10:59 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 27 Aug 2018 07:39:39 +0000 (03:39 -0400)
The test tries to link shader with XFB variables in TCS, without TES stage.
The test expects the shader to fail linking, but this behavior does not
seem to be mandated by GL spec.

According to GL 4.6 spec (
https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf - page 387)
- It is not forbidden to use TransformFeedbackVaryings with Tessellation Control
Shader and the spec does not mandate linking failure, even without NV_gpu_shader5
extension.

Test seems to derive this behavior from OGL ES spec where XFB is not allowed
within TCS shader.

Components: OpenGL

VK-GL-CTS Issue: 1221

Affects:
KHR-GL45.tessellation_shader.single.xfb_captures_data_from_correct_stage

Change-Id: Ie7c4209e0a36d48e56df04030ed095741bda155a

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

index d560089..cbc1623 100644 (file)
@@ -295,8 +295,9 @@ void TessellationShaderXFB::initTest()
        GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource() failed for fragment shader");
 
        /* Create a fragment shader program */
-       glw::GLint                 link_status  = GL_FALSE;
-       const glw::GLchar* varying_name = "BLOCK_INOUT.value";
+       glw::GLint                 link_status                  = GL_FALSE;
+       const glw::GLchar* varying_name                 = "BLOCK_INOUT.value";
+       const glw::GLchar* varying_array_name   = "BLOCK_INOUT[0].value";
 
        m_fs_program_id = createSeparableProgram(GL_FRAGMENT_SHADER, 1, /* n_strings */
                                                                                         &fs_body, 0,                   /* n_varyings */
@@ -383,10 +384,7 @@ void TessellationShaderXFB::initTest()
        GLU_EXPECT_NO_ERROR(gl.getError(), "glShaderSource() failed for tessellation control shader");
 
        /* Test creating a tessellation control shader program with feedback.
-        * For Desktop, if GL_NV_gpu_shader5 is available this will succeed, and
-        * so we'll use it for our testing.
-        * For ES, and for Desktop implementations that don't have
-        * GL_NV_gpu_shader5, this will fail, and so we will create a different
+        * For ES, this will fail, and so we will create a different
         * program without the feedback varyings that we can use for our testing.
         * (We can safely ignore the return value for the expected failure case.
         * In the event that the failure case incorrectly succeeds,
@@ -394,7 +392,7 @@ void TessellationShaderXFB::initTest()
         */
 
        bool tc_feedback_valid;
-       if (!glu::isContextTypeES(m_context.getRenderContext().getType()) && isExtensionSupported("GL_NV_gpu_shader5"))
+       if (!glu::isContextTypeES(m_context.getRenderContext().getType()))
        {
                tc_feedback_valid = true;
        }
@@ -406,7 +404,7 @@ void TessellationShaderXFB::initTest()
        /* Create a tessellation control shader program */
        m_tc_program_id = createSeparableProgram(m_glExtTokens.TESS_CONTROL_SHADER, 1, /* n_strings */
                                                                                         &tc_body, 1,                                              /* n_varyings */
-                                                                                        &varying_name,                                            /* varyings */
+                                                                                        &varying_array_name,                              /* varyings */
                                                                                         tc_feedback_valid);                               /* should_succeed */
 
        if (!tc_feedback_valid)