Window systems (read dri3) that allocate a fake frontbuffer on demand will
effectively read out from the real front before the first swapbuffers after
fake front creation, and the real front buffer content is subject to errors
caused by, among other things, window reparenting. So increase the likelyhood
of not reading out from the real front by advertizing early that we will
access the front buffer. After all, real front consistency is not the objective
of this test.

Fixes sporadic failures due to window reparenting on dri3/vmwgfx.

Cc: Brian Paul <bri...@vmware.com>
Signed-off-by: Thomas Hellstrom <thellst...@vmware.com>
---
 tests/spec/gl-1.0/swapbuffers-behavior.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/gl-1.0/swapbuffers-behavior.c 
b/tests/spec/gl-1.0/swapbuffers-behavior.c
index d914020..15a07ac 100644
--- a/tests/spec/gl-1.0/swapbuffers-behavior.c
+++ b/tests/spec/gl-1.0/swapbuffers-behavior.c
@@ -62,6 +62,7 @@ piglit_display(void)
 
        /* Clear back buffer to green */
        glDrawBuffer(GL_BACK);
+       glReadBuffer(GL_FRONT);
        glClearColor(green[0], green[1], green[2], green[3]);
        glClear(GL_COLOR_BUFFER_BIT);
 
@@ -69,7 +70,6 @@ piglit_display(void)
        piglit_swap_buffers();
 
         /* Front buffer sanity-check */
-       glReadBuffer(GL_FRONT);
        if (!piglit_probe_rect_rgb_silent(0, 0, piglit_width, piglit_height,
                                          green)) {
                printf("SwapBuffers apparently failed!\n");
-- 
2.7.4

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to