[Piglit] [PATCH 1/2] fbo-mipmap-copypix: Probe pixels before SwapBuffers

Ian Romanick idr at freedesktop.org
Tue Jan 17 16:00:41 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.  Don't call SwapBuffers at all of -auto is
used.  The flashing lights don't help anyone.

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

diff --git a/tests/fbo/fbo-mipmap-copypix.c b/tests/fbo/fbo-mipmap-copypix.c
index 84f9f41..af2fe48 100644
--- a/tests/fbo/fbo-mipmap-copypix.c
+++ b/tests/fbo/fbo-mipmap-copypix.c
@@ -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,9 @@ test_mipmap_copypixels(GLenum srcIntFormat, GLenum dstIntFormat,
       }
 
       size /= 2;
+
+      if (!piglit_automatic)
+	 glutSwapBuffers();
    }
 
    glDisable(GL_TEXTURE_2D);
-- 
1.7.6.4



More information about the Piglit mailing list