I haven't seen that solution, but at least with nVidia and AMD drivers, 
it should be unnecessary, since both provide a mechanism for specifying 
that glXSwapBuffers() should be synced to the monitor's vertical 
refresh.  On nVidia, you can control this "on the fly" by setting the 
environment variable __GL_SYNC_TO_VBLANK:

> DISPLAY=:0 glxspheres
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x2c
Context is Direct
OpenGL Renderer: Quadro K5000/PCIe/SSE2
2220.090984 frames/sec - 2477.621539 Mpixels/sec

> DISPLAY=:0 __GL_SYNC_TO_VBLANK=1 glxspheres
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x2c
Context is Direct
OpenGL Renderer: Quadro K5000/PCIe/SSE2
60.968045 frames/sec - 68.040339 Mpixels/sec

As to why VirtualGL can be used to accomplish the same thing, I'm not 
entirely sure, but what's happening behind the scenes is that VirtualGL 
is forcing all of the OpenGL rendering to occur off-screen, in a Pbuffer 
(which isn't affected by the vertical refresh.)  When glXSwapBuffers() 
is called, VirtualGL reads back the Pbuffer and delivers it into a frame 
queue, where the X11 Transport picks it up and draws it using 
XShmPutImage().  As to why that causes the drawing to be synced to the 
vertical refresh, I don't know exactly, but it makes sense that it 
would.  From the point of view of the X server, essentially VirtualGL is 
converting the application from a 3D application into a video player.


On 10/22/15 9:55 AM, Guinnup, Christopher D. wrote:
> Hi,
>
> How is installing VirtualGL and then launching my application with
> ‘vglrun’ fixing an x11grab (screen capture) overlay-flickering issue?  I
> came upon the solution online, but with no explanation for why it works,
> and now I’m very curious.
>
> After pouring over the VirtualGL documentation, I’ve gathered that it’s
> using X11 Transport since the connection is local. If I were to hazard I
> guess: the flickering (which was never visible on the monitor, just the
> captured video) may’ve been caused by grabbing a frame from X11 before
> the GPU completely rendered the overlays. And now that X11 Transport is
> painting full images with XPutImage(), it can’t grab mid-render anymore?
>
> Is my explanation totally off-base?
>
> I imagine running this way (vs. without VirtualGL) has at least a small
> performance impact.  But if it’s the best way to solve the issue, would
> be worth it!

------------------------------------------------------------------------------
_______________________________________________
VirtualGL-Users mailing list
VirtualGL-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-users

Reply via email to