summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-09-08 11:30:36 -0700
committerEric Anholt <eric@anholt.net>2010-09-08 11:30:36 -0700
commit69cf27b3b3db35b70485e356f06ed638276c6467 (patch)
treecea698ec18d130fdcd3b2fa0e98e563e8ddc3de8
parenta3f84a91709d361b1cc9332c1756a8683a6925d5 (diff)
Fix several tests that were probing after swapbuffers.
These would fail in the presence of compiz on the intel driver, where the undefined behavior you get by looking at the back after a swap is no longer the same pixels you last put there.
-rw-r--r--tests/general/scissor-bitmap.c5
-rw-r--r--tests/texturing/gen-nonzero-unit.c9
-rw-r--r--tests/texturing/gen-teximage.c9
-rw-r--r--tests/texturing/gen-texsubimage.c7
-rw-r--r--tests/texturing/streaming-texture-leak.c4
5 files changed, 15 insertions, 19 deletions
diff --git a/tests/general/scissor-bitmap.c b/tests/general/scissor-bitmap.c
index 3469393ff..88353c1bc 100644
--- a/tests/general/scissor-bitmap.c
+++ b/tests/general/scissor-bitmap.c
@@ -286,13 +286,12 @@ piglit_display()
fdo_bitmap_width, fdo_bitmap_height * 3 / 4,
0, 0);
- glutSwapBuffers();
- glFlush();
-
for (i = 0; i < probes.n_probes; i++) {
pass = pass && verify_bitmap_contents(&probes, i);
}
+ glutSwapBuffers();
+
return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}
diff --git a/tests/texturing/gen-nonzero-unit.c b/tests/texturing/gen-nonzero-unit.c
index 7355d839a..358d210ec 100644
--- a/tests/texturing/gen-nonzero-unit.c
+++ b/tests/texturing/gen-nonzero-unit.c
@@ -157,15 +157,14 @@ piglit_display(void)
fill_level(0, red);
display_mipmaps(0, SIZE * 2);
- glDeleteTextures(3, textures);
-
- glutSwapBuffers();
- glFlush();
-
pass = pass && check_resulting_mipmaps(0, 0, red);
pass = pass && check_resulting_mipmaps(0, SIZE, blue);
pass = pass && check_resulting_mipmaps(0, SIZE * 2, red);
+ glutSwapBuffers();
+
+ glDeleteTextures(3, textures);
+
return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}
diff --git a/tests/texturing/gen-teximage.c b/tests/texturing/gen-teximage.c
index bcc163db9..2bea91555 100644
--- a/tests/texturing/gen-teximage.c
+++ b/tests/texturing/gen-teximage.c
@@ -145,15 +145,14 @@ piglit_display(void)
fill_level(0, red);
display_mipmaps(0, SIZE * 2);
- glDeleteTextures(1, &texture);
-
- glutSwapBuffers();
- glFlush();
-
pass = pass && check_resulting_mipmaps(0, 0, red);
pass = pass && check_resulting_mipmaps(0, SIZE, blue);
pass = pass && check_resulting_mipmaps(0, SIZE * 2, red);
+ glutSwapBuffers();
+
+ glDeleteTextures(1, &texture);
+
return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}
diff --git a/tests/texturing/gen-texsubimage.c b/tests/texturing/gen-texsubimage.c
index 3b0c75a3d..bc9f841cb 100644
--- a/tests/texturing/gen-texsubimage.c
+++ b/tests/texturing/gen-texsubimage.c
@@ -124,13 +124,12 @@ piglit_display(void)
/* Display the mipmaps after subimage */
display_mipmaps(0, 256);
- glDeleteTextures(1, &texture);
+ pass = pass && check_resulting_mipmaps(0, 0, blue);
+ pass = pass && check_resulting_mipmaps(0, 256, red);
glutSwapBuffers();
- glFlush();
- pass = pass && check_resulting_mipmaps(0, 0, blue);
- pass = pass && check_resulting_mipmaps(0, 256, red);
+ glDeleteTextures(1, &texture);
return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}
diff --git a/tests/texturing/streaming-texture-leak.c b/tests/texturing/streaming-texture-leak.c
index 67e7b77cb..3003dfb64 100644
--- a/tests/texturing/streaming-texture-leak.c
+++ b/tests/texturing/streaming-texture-leak.c
@@ -70,11 +70,11 @@ piglit_display(void)
glDeleteTextures(1, &texture);
}
- glutSwapBuffers();
-
pass = piglit_probe_pixel_rgb(piglit_width / 2, piglit_height / 2,
expected);
+ glutSwapBuffers();
+
return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
}