[Piglit] [PATCH 2/2] glx: Replace glFlush calls with glFinish

Paul Berry stereotype441 at gmail.com
Mon Nov 19 10:57:35 PST 2012


Currently, in Mesa with the i965 driver, calling glFlush() forces all
pending drawing operations to be sent to the kernel; this ensures that
any subsequent drawing operations will be performed after those
pending drawing operations, even if they come from other contexts.
The glx-multithread test was relying on this behaviour, however, the
GL and GLX specs do not garantee this.

This patch modifies the glx-multithread test to use glFinish() instead
of glFlush().
---
 tests/glx/glx-multithread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/glx/glx-multithread.c b/tests/glx/glx-multithread.c
index c5b4f98..ad3ee46 100644
--- a/tests/glx/glx-multithread.c
+++ b/tests/glx/glx-multithread.c
@@ -55,7 +55,7 @@ thread_func(void *arg)
 	glColor4f(0.0, 1.0, 0.0, 0.0);
 	piglit_draw_rect(*x, 10, 10, 10);
 
-	glFlush();
+	glFinish();
 	glXDestroyContext(dpy, ctx);
 
 	return NULL;
@@ -79,7 +79,7 @@ draw(Display *dpy)
 	/* Clear background to gray */
 	glClearColor(0.5, 0.5, 0.5, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
-	glFlush();
+	glFinish();
 
 	/* Now, spawn some threads that do some drawing, both with this
 	 * context
-- 
1.8.0



More information about the Piglit mailing list