[Piglit] [PATCH 2/2] Fix spurious failures in GL_ARB_sync/sync-initialize.

Eric Anholt eric at anholt.net
Thu Dec 5 17:57:00 PST 2013


You can't just fire off some rendering and assert that it won't be
done by the time you get around to executing your query.  Plus the
rendering was broken and throwing INVALID_OPERATION when the test was
executed in core mode, anyway, since there was no shader bound.
---
 tests/spec/arb_sync/sync-initialize.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tests/spec/arb_sync/sync-initialize.c b/tests/spec/arb_sync/sync-initialize.c
index e6f9077..6c7283d 100644
--- a/tests/spec/arb_sync/sync-initialize.c
+++ b/tests/spec/arb_sync/sync-initialize.c
@@ -65,11 +65,6 @@ piglit_init(int argc, char **argv)
 		piglit_require_extension("GL_ARB_sync");
 	}
 
-	/* Start some rendering that will not end before this test finishes
-	 * in order to make sure the fence sync is still set to initial values
-	 */
-	piglit_draw_rect(-1, -1, 2, 2);
-
 	/* Create a new fence sync */
 	sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
 
@@ -108,8 +103,12 @@ piglit_init(int argc, char **argv)
 			length);
 		pass = false;
 	}
-	if (value != GL_UNSIGNALED) {
-		printf("Expected GL_UNSIGNALED but returned: %s\n",
+	/* We can't test for just GL_UNSIGNALED here, since the driver
+	 * may have actually completed any previous rendering (or, in
+	 * our case, no rendering at all) already.
+	 */
+	if (value != GL_UNSIGNALED && value != GL_SIGNALED) {
+		printf("Expected GL_UNSIGNALED or GL_SIGNALED but returned: %s\n",
 			piglit_get_gl_enum_name(value));
 		pass = false;
 	}
-- 
1.8.4.4



More information about the Piglit mailing list