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

Eric Anholt eric at anholt.net
Tue Jan 17 22:47:22 PST 2012


On Tue, 17 Jan 2012 16:56:51 -0800, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/17/2012 04:27 PM, Eric Anholt wrote:
> > On Tue, 17 Jan 2012 16:00:41 -0800, "Ian Romanick"<idr at freedesktop.org>  wrote:
> >> 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();
> >
> > If you're going to check for automatic here, care to just use
> > piglit_present_results() and make it concurrent?
> 
> I can, but what's the equivalent to glBindFramebuffer(GL_FRAMEBUFFER, 0) 
> for the -fbo case?

Ah, oops, I missed that it needed that.  Need to expose the (possibly
actually an FBO) window system FBO name in framework, so scratch my
comment unless you feel like doing that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120117/d22cd1ee/attachment.pgp>


More information about the Piglit mailing list