GL44-CTS.khr_debug: do not call missing functions and properly create texture
authorSlawomir Cygan <slawomir.cygan@intel.com>
Thu, 1 Dec 2016 18:05:49 +0000 (19:05 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 1 Feb 2017 11:45:41 +0000 (06:45 -0500)
glCreateBuffers was introduced by DSA in GL45, however this test can run also
in GL44 mode. Do not call it.

Additionaly add glBindTexture call before glIsTexture, so texture is properly
created before check.

Changed tests:
GL44-CTS.khr_debug.*

Components: OpenGL
VK-GL-CTS Issue: 27

Change-Id: I8397bc10f64194cc7bce32f67260066b8101a3f6

external/openglcts/modules/gl/gl4cKHRDebugTests.cpp

index c58adf7..64e3531 100644 (file)
@@ -519,6 +519,7 @@ tcu::TestNode::IterateResult APIErrorsTest::iterate()
                GLuint texture_id = 0;
                GLuint invalid_id = 1;
                m_gl->genTextures(1, &texture_id);
+               m_gl->bindTexture(GL_TEXTURE_2D, texture_id);
                GLU_EXPECT_NO_ERROR(m_gl->getError(), "GenTextures");
 
                try
@@ -874,12 +875,21 @@ tcu::TestNode::IterateResult LabelsTest::iterate()
  *
  * @return ID of created resource
  **/
-GLuint LabelsTest::createBuffer(const Functions* gl, const glu::RenderContext*)
+GLuint LabelsTest::createBuffer(const Functions* gl, const glu::RenderContext* rc)
 {
        GLuint id = 0;
 
-       gl->createBuffers(1, &id);
-       GLU_EXPECT_NO_ERROR(gl->getError(), "CreateBuffers");
+       if (glu::contextSupports(rc->getType(), glu::ApiType::core(4, 5)))
+       {
+               gl->createBuffers(1, &id);
+               GLU_EXPECT_NO_ERROR(gl->getError(), "CreateBuffers");
+       }
+       else
+       {
+               gl->genBuffers(1, &id);
+               gl->bindBuffer(GL_ARRAY_BUFFER, id);
+               GLU_EXPECT_NO_ERROR(gl->getError(), "GenBuffers");
+       }
 
        return id;
 }