Don't check color outcome for tests that expect undefined behaviour
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 26 Sep 2019 09:55:49 +0000 (11:55 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 8 Oct 2019 08:04:48 +0000 (04:04 -0400)
draw_indirect.misc-reservedMustBeZero-elements and its arrays
equivalent for both OpenGL and OpenGL ES tests the following paragraph
from the spec:

  "Results are undefined if reservedMustBeZero is non-zero, but must
   not lead to GL interruption or termination."

So it should check if there is no errors or crashes. But right now
those tests are also expecting a given color, that doesn't make sense
if the expected behaviour by spec is undefined.

This seems a C&P error from other tests.

Components: OpenGL, OpenGL ES

VK-GL-CTS issue: 2023

Affects:
KHR-GL41.draw_indirect.misc-reservedMustBeZero-arrays
KHR-GL41.draw_indirect.misc-reservedMustBeZero-elements
KHR-GLES31.core.draw_indirect.misc-reservedMustBeZero-arrays
KHR-GLES31.core.draw_indirect.misc-reservedMustBeZero-elements

Change-Id: I3e9a5d04893eec9359b55ea6c5130e940c943cf2

external/openglcts/modules/gles31/es31cDrawIndirectTests.cpp

index 265577e..982f126 100644 (file)
@@ -5780,13 +5780,15 @@ class CNonZeroReservedMustBeZeroArray : public DrawIndirectBase
 
                glDrawArraysIndirect(GL_TRIANGLES, 0);
 
-               CColorArray bufferRef(getWindowWidth() * getWindowHeight(), tcu::Vec4(0.1f, 0.2f, 0.3f, 1.0f));
-               CColorArray bufferTest(getWindowWidth() * getWindowHeight(), tcu::Vec4(0.0f));
-
                DIResult result;
-               ReadPixelsFloat<api>(0, 0, getWindowWidth(), getWindowHeight(), &bufferTest[0]);
-               result.sub_result(BuffersCompare(bufferTest, getWindowWidth(), getWindowHeight(), bufferRef, getWindowWidth(),
-                                                                                getWindowHeight()));
+               if (glGetError() == GL_NO_ERROR)
+               {
+                       //No GL error: undefined
+               }
+               else
+               {
+                       result.error() << "Invalid error code returned by a driver";
+               }
 
                return result.code();
        }
@@ -5882,13 +5884,15 @@ struct CNonZeroReservedMustBeZeroElements : public DrawIndirectBase
 
                glDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_INT, 0);
 
-               CColorArray bufferRef(getWindowWidth() * getWindowHeight(), tcu::Vec4(0.1f, 0.2f, 0.3f, 1.0f));
-               CColorArray bufferTest(getWindowWidth() * getWindowHeight(), tcu::Vec4(0.0f));
-
                DIResult result;
-               ReadPixelsFloat<api>(0, 0, getWindowWidth(), getWindowHeight(), &bufferTest[0]);
-               result.sub_result(BuffersCompare(bufferTest, getWindowWidth(), getWindowHeight(), bufferRef, getWindowWidth(),
-                                                                                getWindowHeight()));
+               if (glGetError() == GL_NO_ERROR)
+               {
+                       //No GL error: undefined
+               }
+               else
+               {
+                       result.error() << "Invalid error code returned by a driver";
+               }
 
                return result.code();
        }