Fix KHR-GL45/46.enhanced_layouts.varying_block_member_locations
authorEleni Maria Stea <estea@igalia.com>
Wed, 20 Sep 2017 11:28:40 +0000 (14:28 +0300)
committerAntia Puentes <apuentes@igalia.com>
Mon, 9 Oct 2017 13:01:39 +0000 (15:01 +0200)
The stages of the same program used in/out blocks that didn't match
(see section 4.7.1 in OpenGL 4.5 spec: qualification mismatch) and as a
result a linker error was produced. With this change all stages use the
same block definition which is either the 1st or the 2nd depending on
the iteration but not both at the same time:

Goku {
    vec4 gohan;
    vec4 goten;
    vec4 chichi;
} gokuARRAY;

Goku {
    layout (location = 2) vec4 gohan;
    layout (location = 4) vec4 goten;
    layout (location = 6) vec4 chichi;
} gokuARRAY;

Affects:

KHR-GL46.enhanced_layouts.varying_block_member_locations
KHR-GL45.enhanced_layouts.varying_block_member_locations

Components: OpenGL

VK-GL-CTS issue: 703

Change-Id: I03a6a90929e28489a2507838003c62475a8a58b8
(cherry picked from commit 4b6462e469359ac7ddec9c63d042e43ead6031fc)

external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp

index 22b9389..23744eb 100644 (file)
@@ -13700,7 +13700,6 @@ std::string VaryingBlockMemberLocationsTest::getShaderSource(GLuint test_case_in
        };
 
        const GLchar* array                                     = "";
-       const GLchar* definition                        = block_definition_default;
        const GLchar* direction                         = "out";
        const GLchar* index                                     = "";
        bool              require_modifications = false;
@@ -13731,6 +13730,9 @@ std::string VaryingBlockMemberLocationsTest::getShaderSource(GLuint test_case_in
                }
        }
 
+       const GLchar* definition = test_case.m_qualify_all ? block_definition_all
+                       : block_definition_default;
+
        if (test_case.m_stage == stage)
        {
                if (true == test_case.m_qualify_all)