Component aliasing on vertex inputs is allowed
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 18 Oct 2017 10:08:54 +0000 (12:08 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 31 Oct 2017 08:48:26 +0000 (04:48 -0400)
From the OpenGL 4.6 spec, section 11.1 Vertex shaders,
page 384:

"It is possible for an application to bind more than one
 attribute name to the same location. This is referred
 to as aliasing. This will only work if only one of the
 aliased attributes is active in the executable program,
 or if no path through the shader consumes more than one
 attribute of a set of attributes aliased to the same
 location. A link error can occur if the linker determines
 that every path through the shader consumes multiple
 aliased attributes, but implementations are not required
 to generate an error in this case."

The varying_location_aliasing_with_mixed_types enhanced
layouts test generates negative tests to check that
component aliasing produces linker errors for all shader
stages, including vertex shaders when the aliasing occurs
on the vertex inputs. By the citation above, the spec
doesn't mandate implementations to produce an error in
this case, so these particular tests are invalid.

This change removes the test cases that expect an error
to be generated for shaders with component aliasing on
vertex shader inputs.

Components: OpenGL
VK-GL-CTS issue: 781

Affects:
KHR-GL45.enhanced_layouts.varying_location_aliasing_with_mixed_types
KHR-GL46.enhanced_layouts.varying_location_aliasing_with_mixed_types

Change-Id: Ie1cafc92c4b7023c3d911ec5fe883dad297029d5

external/openglcts/modules/gl/gl4cEnhancedLayoutsTests.cpp

index 75e5adf..b4aedab 100644 (file)
@@ -17853,7 +17853,8 @@ void VaryingLocationAliasingWithMixedTypesTest::testInit()
                                                testCase test_case_out = { gohan,         goten,         false, (Utils::Shader::STAGES)stage,
                                                                                                   type_gohan, type_goten };
 
-                                               m_test_cases.push_back(test_case_in);
+                                               if (Utils::Shader::VERTEX != stage)
+                                                       m_test_cases.push_back(test_case_in);
 
                                                /* Skip double outputs in fragment shader */
                                                if ((Utils::Shader::FRAGMENT != stage) || ((Utils::Type::Double != type_gohan.m_basic_type) &&
@@ -17871,7 +17872,8 @@ void VaryingLocationAliasingWithMixedTypesTest::testInit()
                                                testCase test_case_out = { gohan,         goten,         false, (Utils::Shader::STAGES)stage,
                                                                                                   type_gohan, type_goten };
 
-                                               m_test_cases.push_back(test_case_in);
+                                               if (Utils::Shader::VERTEX != stage)
+                                                       m_test_cases.push_back(test_case_in);
 
                                                /* Skip double outputs in fragment shader */
                                                if ((Utils::Shader::FRAGMENT != stage) || ((Utils::Type::Double != type_gohan.m_basic_type) &&