Skip FRAMEBUFFER_UNSUPPORTED subtests on DSA textures_buffer
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 2 Mar 2017 17:49:50 +0000 (18:49 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 10 Mar 2017 16:56:12 +0000 (11:56 -0500)
From OpenGL 4.5 spec, section 9.4.2 "Whole Framebuffer Completeness":

   "Although the GL defines a wide variety of internal formats for
    framebuffer-attachable images, such as texture images and
    renderbuffer images, some implementations may not support
    rendering to particular combinations of internal formats. If the
    combination of formats of the images attached to a framebuffer
    object are not supported by the implementation, then the
    framebuffer is not complete under the clause labeled
    FRAMEBUFFER_UNSUPPORTED .

    Implementations are required to support certain combinations of
    framebuffer internal formats as described under “Required
    Framebuffer Formats” in sec- tion 9.4.3."

That means that if the combination being tested returns
FRAMEBUFFER_UNSUPPORTED, it is still allowed by OpenGL spec. For those
cases, the test should skip instead of fail.

Affects:
GL45-CTS.direct_state_access.textures_buffer

Components: OpenGL

VK-GL-CTS: 201

Change-Id: Ia272a975e8417837637cd47b621b91306d1aa567

external/openglcts/modules/gl/gl4cDirectStateAccessTests.hpp
external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp

index 838c975..5dc2f20 100644 (file)
@@ -4975,7 +4975,7 @@ private:
        template <typename T, glw::GLint S, bool N>
        bool Test(bool use_range_version);
 
-       void PrepareFramebuffer(const glw::GLenum internal_format);
+       bool PrepareFramebuffer(const glw::GLenum internal_format);
        void PrepareProgram(const glw::GLchar* variable_declaration);
        void PrepareVertexArray();
        void Draw();
index 8221379..d470c7d 100644 (file)
@@ -902,8 +902,10 @@ bool BufferTest::CreateBufferTexture(bool use_range_version)
  *         Viewport is set up. Content of the framebuffer is cleared.
  *
  *  @note The function may throw if unexpected error has occured.
+ *
+ *  @return if the framebuffer returned is supported
  */
-void BufferTest::PrepareFramebuffer(const glw::GLenum internal_format)
+bool BufferTest::PrepareFramebuffer(const glw::GLenum internal_format)
 {
        /* Shortcut for GL functionality. */
        const glw::Functions& gl = m_context.getRenderContext().getFunctions();
@@ -929,7 +931,10 @@ void BufferTest::PrepareFramebuffer(const glw::GLenum internal_format)
 
        if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
        {
-               throw 0;
+               if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_UNSUPPORTED)
+                       return false;
+               else
+                       throw 0;
        }
 
        gl.viewport(0, 0, s_fbo_size_x, s_fbo_size_y);
@@ -941,6 +946,8 @@ void BufferTest::PrepareFramebuffer(const glw::GLenum internal_format)
 
        gl.clear(GL_COLOR_BUFFER_BIT);
        GLU_EXPECT_NO_ERROR(gl.getError(), "glClear call failed.");
+
+       return true;
 }
 
 /** @brief Create program.
@@ -1187,7 +1194,19 @@ template <typename T, glw::GLint S, bool N>
 bool BufferTest::Test(bool use_range_version)
 {
        /* Setup. */
-       PrepareFramebuffer(InternalFormat<T, S, N>());
+       if (!PrepareFramebuffer(InternalFormat<T, S, N>()))
+       {
+               /**
+                 * If the framebuffer it not supported, means that the
+                 * tested combination is unsupported for this driver,
+                 * but allowed to be unsupported by OpenGL spec, so we
+                 * just skip.
+                 */
+               CleanFramebuffer();
+               CleanErrors();
+
+               return true;
+       }
 
        if (!CreateBufferTexture<T, S, N>(use_range_version))
        {