[Piglit] [PATCH 2/2] fbo-mipmap-copypix: Probe pixels before SwapBuffers, make concurrent

Ian Romanick idr at freedesktop.org
Thu Jan 19 08:42:45 PST 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Calling SwapBuffers may invalidate the back buffer, and the default
read buffer is GL_BACK.  Since the flashing lights don't help anyone,
use piglit_present_results (and the new piglit_set_default_fbo) to
allow this test to run concurrently without a window.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/all.tests                |    2 +-
 tests/fbo/fbo-mipmap-copypix.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index da640dc..4dc3d48 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -194,7 +194,7 @@ add_plain_test(fbo, 'fbo-incomplete-texture-03')
 add_plain_test(fbo, 'fbo-incomplete-texture-04')
 add_plain_test(fbo, 'fbo-integer')
 add_plain_test(fbo, 'fbo-maxsize')
-add_plain_test(fbo, 'fbo-mipmap-copypix')
+add_concurrent_test(fbo, 'fbo-mipmap-copypix')
 add_plain_test(fbo, 'fbo-nodepth-test')
 add_plain_test(fbo, 'fbo-nostencil-test')
 add_plain_test(fbo, 'fbo-pbo-readpixels-small')
diff --git a/tests/fbo/fbo-mipmap-copypix.c b/tests/fbo/fbo-mipmap-copypix.c
index 84f9f41..28be86e 100644
--- a/tests/fbo/fbo-mipmap-copypix.c
+++ b/tests/fbo/fbo-mipmap-copypix.c
@@ -182,7 +182,7 @@ test_mipmap_copypixels(GLenum srcIntFormat, GLenum dstIntFormat,
    glDeleteFramebuffers(1, &fboSrc);
    glDeleteFramebuffers(1, &fboDst);
 
-   glBindFramebuffer(GL_FRAMEBUFFER, 0);
+   piglit_set_default_fbo(GL_FRAMEBUFFER);
 
    if (!pass)
       return GL_FALSE;
@@ -205,8 +205,6 @@ test_mipmap_copypixels(GLenum srcIntFormat, GLenum dstIntFormat,
       piglit_draw_rect_tex(0, 0, piglit_width, piglit_height,
                            0.0, 0.0, 1.0, 1.0);
 
-      glutSwapBuffers();
-
       p = piglit_probe_pixel_rgba(piglit_width/2, piglit_height/2, colors[level]);
       if (!p) {
          printf("  Mipmap level %d\n", level);
@@ -224,6 +222,8 @@ test_mipmap_copypixels(GLenum srcIntFormat, GLenum dstIntFormat,
       }
 
       size /= 2;
+
+      piglit_present_results();
    }
 
    glDisable(GL_TEXTURE_2D);
-- 
1.7.6.4



More information about the Piglit mailing list