To guarantee correctness with applications that do
2D-over-3D drawing we must always sync the 3D bits
within the X stream.

Example of what happened previously, with Cadence Allegro:

1. Allegro draws to front buffer with GL
2. Allegro does glFlush
3. VGL adds frame to queue in separate thread
4. Allegro does 2D XOR drawing to window
5. VGL queue frame arrives, overwrites XOR drawing
6. Allegro "erases" 2D XOR drawing, but actually ends up
   making it visible.

Sometimes 5) could come before 4), and drawing was OK,
but mostly it looses that race.

Possible side-effect:

Theoretical application that does excessive glFlush'ing and
requires VGL_SYNC=1 for, e.g. glXSwapBuffers but not for glFlush
will become unusably slow.  If such an application is found
then an option could be added to not sync on glFlush.

-Nathan
Index: server/faker-gl.cpp
===================================================================
--- server/faker-gl.cpp	(revision 3558)
+++ server/faker-gl.cpp	(working copy)
@@ -90,7 +90,7 @@
 
 	// See the notes regarding VGL_SPOILLAST and VGL_GLFLUSHTRIGGER in the
 	// VirtualGL User's Guide.
-	if(fconfig.glflushtrigger) doGLReadback(fconfig.spoillast, false);
+	if(fconfig.glflushtrigger) doGLReadback(fconfig.spoillast, fconfig.sync);
 
 	CATCH();
 }
Index: server/faker-glx.cpp
===================================================================
--- server/faker-glx.cpp	(revision 3558)
+++ server/faker-glx.cpp	(working copy)
@@ -1643,7 +1643,7 @@
 			|| newvw->getGLXDrawable()!=curdraw)
 		{
 			if(drawingToFront() || vw->dirty)
-				vw->readback(GL_FRONT, false, false);
+				vw->readback(GL_FRONT, false, fconfig.sync);
 		}
 	}
 
@@ -1740,7 +1740,7 @@
 			|| newvw->getGLXDrawable()!=curdraw)
 		{
 			if(drawingToFront() || vw->dirty)
-				vw->readback(GL_FRONT, false, false);
+				vw->readback(GL_FRONT, false, fconfig.sync);
 		}
 	}
 
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
VirtualGL-Devel mailing list
VirtualGL-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-devel

Reply via email to