[Piglit] [PATCH] gl-1.0/swapbuffers-behavior: Try avoid reading from real front

Brian Paul brianp at vmware.com
Wed Jun 21 14:20:22 UTC 2017


On 06/21/2017 06:24 AM, Thomas Hellstrom wrote:
> 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 <brianp at vmware.com>
> Signed-off-by: Thomas Hellstrom <thellstrom at 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);

The comment no longer agrees with the code.

>   	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);

Same here.

>   	if (!piglit_probe_rect_rgb_silent(0, 0, piglit_width, piglit_height,
>   					  green)) {
>   		printf("SwapBuffers apparently failed!\n");
>

These changes seem to defeat the purpose of the test.

Would a different approach work?  How about after the initial glViewport 
call we simply clear the front buffer?  That should trigger creation of 
the fake front buffer, right?

-Brian



More information about the Piglit mailing list