Do not exceed GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 6 Jun 2017 06:53:47 +0000 (08:53 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 9 Jun 2017 15:49:19 +0000 (11:49 -0400)
The transform feedback tests query the limit but never actually used it
to clamp the number of attributes used with GL_SEPARATE_ATTRIBS.

Components: OpenGL
VK-GL-CTS issue: 469

Affects:
KHR-GL45.transform_feedback.get_xfb_varying

Change-Id: Ie0b89233024e2e10bacc1e9b2f9969c0da3a9e29

external/openglcts/modules/gl/gl3cTransformFeedbackTests.cpp

index 80331ac..c84b958 100644 (file)
@@ -3466,6 +3466,12 @@ glw::GLuint gl3cts::TransformFeedback::CheckGetXFBVarying::numberOfAttributes(gl
        /* Setup number of attributes. */
        glw::GLuint number_of_attributes = max_xfb_components / attribute_components;
 
+       if (s_capture_ways[capture_way] == GL_SEPARATE_ATTRIBS &&
+               number_of_attributes > glw::GLuint(m_max_xfb_separate_attributes))
+       {
+               number_of_attributes = m_max_xfb_separate_attributes;
+       }
+
        /* Clamp to limits. */
        if (number_of_attributes * attribute_components > max_total_components)
        {