From ce9e355c661f66828c7c173c7bda0859a3902689 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Thu, 26 Sep 2019 11:55:49 +0200 Subject: [PATCH] Don't check color outcome for tests that expect undefined behaviour 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 --- .../modules/gles31/es31cDrawIndirectTests.cpp | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/external/openglcts/modules/gles31/es31cDrawIndirectTests.cpp b/external/openglcts/modules/gles31/es31cDrawIndirectTests.cpp index f357396..45b9ee1 100644 --- a/external/openglcts/modules/gles31/es31cDrawIndirectTests.cpp +++ b/external/openglcts/modules/gles31/es31cDrawIndirectTests.cpp @@ -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(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(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(); } -- 2.7.4