I develop a Linux GLX/OpenGL interposer called VirtualGL, which can be used to provide GPU acceleration for OpenGL applications running in Linux remote display environments such as VNC or NX. Normally and historically, VirtualGL intercepts GLX commands from the OpenGL application, redirects them to the GPU-attached X server in the host (which we call the “3D X server”), and modifies the GLX commands such that OpenGL rendering intended for an X window is redirected into a Pbuffer on the 3D X server. When certain synchronization commands are called by the application (glXSwapBuffers() if rendering to the back buffer; or glFinish(), glXWaitGL(), and sometimes glFlush() if rendering to the front buffer), VirtualGL reads back the OpenGL-rendered pixels and transports them to the appropriate place in the application’s X window, thus eliminating the need for the remote display environment to inherently support OpenGL (even if the remote display environment does inherently support OpenGL, the built-in implementation is unaccelerated.)
I am working on an EGL device back end for VirtualGL, which translates GLX commands into EGL commands (using the EGL_EXT_platform_device extension) and thus eliminates the need for a 3D X server. The problem is that EGL doesn’t support multi-view/multi-buffer Pbuffers, so it is necessary for me to use FBOs with either RBOs or render textures in order to emulate the functionality of a GLX/OpenGL window (specifically, double buffering/multi-buffering) using an EGL Pbuffer surface. The problem I’m encountering is that, in order to fully emulate the functionality of a GLX/OpenGL window, the RBO or texture has to be shareable among multiple OpenGL contexts. I’ve been googling like a demon for two days, and I’m getting conflicting information regarding whether that is possible. Sharing the FBO container definitely does not appear to be possible, but I’ve read in several places that it should be possible to share the RBO or render texture. However, I can’t make that work. Unfortunately, sharing the context at the EGL level isn’t possible, because since VGL is an interposer, sharing of OpenGL contexts is controlled by the OpenGL application. So what I’m looking for is a way to share RBOs or textures among EGL contexts, even if the EGL context was not created as a shared context. Without that ability, the contents of the OpenGL window would-- from the OpenGL application’s point of view-- be specific to a particular context, and that is not conformant with the GLX spec.
Would immutable textures do this for me? That’s the only thing I think I haven’t tried yet, but I am open to any ideas at this point.