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

Marcin Slusarz marcin.slusarz at gmail.com
Sun Oct 9 14:48:35 PDT 2011


It started with level 0 covering whole texture and then drawed
behind texture border, which lead to random test failures.
---
 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;
 	}
 
 	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



More information about the Piglit mailing list