diff options
author | Brian Paul <brianp@vmware.com> | 2013-03-18 18:13:02 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2013-03-19 08:10:51 -0600 |
commit | 0159bc7c6110f2eca940707fb85c27d6975ebdef (patch) | |
tree | 1ff189f673e4f917158ba43d9d2b1ce28b33bd4e | |
parent | 011e5f9a377f2c508ac2fcd319e4297268afbc6a (diff) |
fbo-clear-formats: clean up error handling
Use piglit_check_gl_error(). Note: we're getting an INVALID_OPERATION
error from glBlitFramebuffer() with NVIDIA's driver. That'll be
investigated/fixed separately. At least the test now reports FAIL
instead of dying on an assertion.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
-rw-r--r-- | tests/fbo/fbo-clear-formats.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/fbo/fbo-clear-formats.c b/tests/fbo/fbo-clear-formats.c index f6b2a727..7a558cc2 100644 --- a/tests/fbo/fbo-clear-formats.c +++ b/tests/fbo/fbo-clear-formats.c @@ -218,7 +218,11 @@ do_stencil_clear(GLenum format, GLuint tex, int level, int size) glDrawBuffer(draw_buffer); glReadBuffer(read_buffer); - assert(glGetError() == 0); + + if (!piglit_check_gl_error(GL_NO_ERROR)) { + /* Should be no error at this point. If there is, report failure */ + piglit_report_result(PIGLIT_FAIL); + } return true; } @@ -285,7 +289,11 @@ create_tex(GLenum internalformat, GLenum baseformat) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level - 1); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); - assert(glGetError() == 0); + if (!piglit_check_gl_error(GL_NO_ERROR)) { + /* Should be no error at this point. If there is, report failure */ + piglit_report_result(PIGLIT_FAIL); + } + return tex; } @@ -323,13 +331,16 @@ draw_stencil_mipmap(int x, int y, int dim, GLuint tex, GLuint level) glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); glBlitFramebuffer(0, 0, dim, dim, x, y, x+dim, y+dim, GL_STENCIL_BUFFER_BIT, GL_NEAREST); + if (!piglit_check_gl_error(GL_NO_ERROR)) { + /* The blit shouldn't generate an error. If it does, report failure */ + piglit_report_result(PIGLIT_FAIL); + } + glBindFramebuffer(GL_FRAMEBUFFER, 0); glDeleteFramebuffers(1, &fbo); glDrawBuffer(draw_buffer); glReadBuffer(read_buffer); - - assert(glGetError() == 0); } static void |