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();
* 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();
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);
gl.clear(GL_COLOR_BUFFER_BIT);
GLU_EXPECT_NO_ERROR(gl.getError(), "glClear call failed.");
+
+ return true;
}
/** @brief Create program.
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))
{