gl4cMapBufferAlignmentTests: ensure that the GL_ARB_buffer_storage extension is present
authorCorentin Noël <corentin.noel@collabora.com>
Fri, 27 Aug 2021 12:03:34 +0000 (14:03 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 7 Jan 2022 21:14:32 +0000 (21:14 +0000)
This make sure that we won't call gl.bufferStorage if this isn't possible.

Affects:

KHR-GL43.map_buffer_alignment.functional

Components: OpenGL

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Change-Id: Icdcfeba5144543ee3d8c762618ff1b7d8752f502

external/openglcts/modules/gl/gl4cMapBufferAlignmentTests.cpp

index 88d950c..0f22393 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "gl4cMapBufferAlignmentTests.hpp"
 
+#include "gluContextInfo.hpp"
 #include "gluDefs.hpp"
 #include "glwEnums.hpp"
 #include "glwFunctions.hpp"
@@ -104,6 +105,7 @@ public:
                /* Nothing to be done */
        }
 
+       void init();
        /** Execute test
         *
         * @return tcu::TestNode::STOP
@@ -150,6 +152,14 @@ struct BufferEnums
        GLenum m_max_size;
 };
 
+void Functional::init(void)
+{
+       if (!m_context.getContextInfo().isExtensionSupported("GL_ARB_buffer_storage"))
+       {
+               TCU_THROW(NotSupportedError, "GL_ARB_buffer_storage not supported");
+       }
+}
+
 /** Execute test
  *
  * @return tcu::TestNode::STOP