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

Marcin Slusarz marcin.slusarz at gmail.com
Mon Oct 10 11:29:28 PDT 2011


On Mon, Oct 10, 2011 at 09:54:32AM -0700, Eric Anholt wrote:
> 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.

It's probably easier to apply attached patch and watch the results,
instead of explaining each line changed...

---
diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index 4f9e916..434f1df 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -415,12 +415,20 @@ test_format(const struct format_desc *format, GLenum baseformat, GLenum basetype
 
 	x = 1;
 	for (level = 0; (tex_width >> level) || (tex_height >> level); level++) {
+		printf("draw, x=%d, level=%d, tex_width=%d, tex_height=%d, tex_width>>level=%d, tex_height>>level=%d\n",
+				x, level, tex_width, tex_height, tex_width >> level, tex_height >> level);
+		if (x >= tex_width)
+			printf("wtf %d >= %d\n", x, tex_width);
 		draw_mipmap(x, 1, level, basetype);
 		x += (tex_width >> level) + 1;
 	}
 
 	x = 1;
 	for (level = 0; (tex_width >> level) || (tex_height >> level); level++) {
+		printf("draw, x=%d, level=%d, tex_width=%d, tex_height=%d, tex_width>>level=%d, tex_height>>level=%d\n",
+				x, level, tex_width, tex_height, tex_width >> level, tex_height >> level);
+		if (x >= tex_width)
+			printf("wtf %d >= %d\n", x, tex_width);
 		pass = pass && test_mipmap_drawing(x, 1, level,
 						   format->internalformat);
 		x += (tex_width >> level) + 1;


More information about the Piglit mailing list