Explicitly set current values before drawing
authorJames Dong <dongja@google.com>
Mon, 8 Jul 2019 16:39:27 +0000 (10:39 -0600)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 13 Aug 2019 06:51:25 +0000 (02:51 -0400)
dEQP-GLES3.functional.vertex_array_objects.all_attributes was relying on
the value of disabled integer attributes. This behavior results in
undefined values, as the initial values for all vertex attributes are of
floating-point type.

Affects:

dEQP-GLES3.functional.vertex_array_objects.all_attributes

Components: AOSP

VK-GL-CTS public issue: 153

Change-Id: I8ffe4b581f100884b46fe68a751bf991cccb71e3

modules/gles3/functional/es3fVertexArrayObjectTests.cpp

index ae9183f..82578b1 100644 (file)
@@ -569,6 +569,14 @@ void VertexArrayObjectTest::makeDrawCall (const VertexArrayState& state)
        GLU_CHECK_CALL(glClearColor(0.7f, 0.7f, 0.7f, 1.0f));
        GLU_CHECK_CALL(glClear(GL_COLOR_BUFFER_BIT));
 
+       for (int attribNdx = 0; attribNdx < (int)state.attributes.size(); attribNdx++)
+       {
+               if (state.attributes[attribNdx].integer)
+                       glVertexAttribI4i(attribNdx, 0, 0, 0, 1);
+               else
+                       glVertexAttrib4f(attribNdx, 0.0f, 0.0f, 0.0f, 1.0f);
+       }
+
        if (m_spec.useDrawElements)
        {
                if (state.elementArrayBuffer == 0)