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)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Sun, 1 Oct 2017 15:00:54 +0000 (11:00 -0400)
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

external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp

index b0a5ee6..de35830 100644 (file)
@@ -13675,7 +13675,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;
@@ -13706,6 +13705,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)