[Piglit] [PATCH] fbo-generatemipmap-formats: fix drawing/testing of mipmaps

Eric Anholt eric at anholt.net
Mon Oct 10 09:54:32 PDT 2011


On Sun, 9 Oct 2011 23:48:35 +0200, Marcin Slusarz <marcin.slusarz at gmail.com> wrote:
> It started with level 0 covering whole texture and then drawed
> behind texture border, which lead to random test failures.

I can't follow what you're trying to fix here.  What texture border?
"Behind"?

> ---
>  tests/fbo/fbo-generatemipmap-formats.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
> index 4f9e916..2453471 100644
> --- a/tests/fbo/fbo-generatemipmap-formats.c
> +++ b/tests/fbo/fbo-generatemipmap-formats.c
> @@ -414,16 +414,16 @@ test_format(const struct format_desc *format, GLenum baseformat, GLenum basetype
>  	tex = create_tex(format->internalformat, baseformat, basetype);
>  
>  	x = 1;
> -	for (level = 0; (tex_width >> level) || (tex_height >> level); level++) {
> +	for (level = 1; tex_width >> level; level++) {
>  		draw_mipmap(x, 1, level, basetype);
> -		x += (tex_width >> level) + 1;
> +		x += tex_width >> level;
>  	}

Why shouldn't we be testing level 0 of the texture?

Why shouldn't we test small mipmap levels if height > width?

Why shouldn't we put some space between the drawings so they're easier
to look at?  (I've sometimes wanted to increase the space I gave, since
1 pixel of background between some green and some red ends up resulting
in funny visual effects on an LCD))

>  
>  	x = 1;
> -	for (level = 0; (tex_width >> level) || (tex_height >> level); level++) {
> +	for (level = 1; tex_width >> level; level++) {
>  		pass = pass && test_mipmap_drawing(x, 1, level,
>  						   format->internalformat);
> -		x += (tex_width >> level) + 1;
> +		x += tex_width >> level;
>  	}
>  
>  	glDeleteTextures(1, &tex);
> -- 
> 1.7.6.1
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- 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/20111010/13147d21/attachment.pgp>


More information about the Piglit mailing list