[Piglit] [PATCH] fbo-missing-attachment-blit: make sure the viewport is, properly initialized.

Ian Romanick idr at freedesktop.org
Mon Nov 7 09:46:15 PST 2011


On 11/06/2011 02:35 PM, Morgan Armand wrote:
> This test reports failure on my computer because the test is launched from piglit_init, before the viewport has a chance
> to be setup correctly. This patch resolve the problem (but maybe the right thing to do is to move the whole test into
> piglit_display).

I didn't have the test run from piglit_display because it doesn't 
display anything. :)  I think this change is correct either way.  The 
OpenGL 3.0 spec says:

     "In the initial state, w and h are set to the width and height,
     respectively, of the window into which the GL is to do its
     rendering. If the default framebuffer is bound but no default
     framebuffer is associated with the GL context (see chapter 4),
     then w and h are initially set to zero. ox and oy are set to
     w/2 and h/2, respectively."

It makes no mention of a default viewport setting for an FBO.

This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   .../fbo-missing-attachment-blit.c                  |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c b/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c
> index 5356505..7ec8c8c 100644
> --- a/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c
> +++ b/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c
> @@ -133,6 +133,7 @@ do_blit_test(bool use_es2, bool from_missing_to_complete)
>   	 * is correct.
>   	 */
>   	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb[src]);
> +	glViewport(0, 0, piglit_width, piglit_height);
>   	glClearDepth(0.0);
>   	glClear(GL_DEPTH_BUFFER_BIT);
>   	glEnable(GL_DEPTH_TEST);



More information about the Piglit mailing list