From: Alejandro Piñeiro Date: Thu, 2 Mar 2017 17:49:50 +0000 (+0100) Subject: Skip FRAMEBUFFER_UNSUPPORTED subtests on DSA textures_buffer X-Git-Tag: upstream/0.1.0~477 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1cdc3c68a00b114597e65b1c89cd330db9b252e;p=platform%2Fupstream%2FVK-GL-CTS.git Skip FRAMEBUFFER_UNSUPPORTED subtests on DSA textures_buffer 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 --- diff --git a/external/openglcts/modules/gl/gl4cDirectStateAccessTests.hpp b/external/openglcts/modules/gl/gl4cDirectStateAccessTests.hpp index 838c975..5dc2f20 100644 --- a/external/openglcts/modules/gl/gl4cDirectStateAccessTests.hpp +++ b/external/openglcts/modules/gl/gl4cDirectStateAccessTests.hpp @@ -4975,7 +4975,7 @@ private: template 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(); diff --git a/external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp b/external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp index 8221379..d470c7d 100644 --- a/external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp +++ b/external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp @@ -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 bool BufferTest::Test(bool use_range_version) { /* Setup. */ - PrepareFramebuffer(InternalFormat()); + if (!PrepareFramebuffer(InternalFormat())) + { + /** + * 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(use_range_version)) {