-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EGL/X11 interposer (+ OpenGL ES support) #66
Comments
The AMDGPU GLX implementation apparently lacks glXSwapIntervalEXT(), which Chrome needs. VGL's interposed version of glXGetProcAddress[ARB]() was unnecessarily strict, checking for the presence of glXSwapIntervalEXT() in the underlying GLX implementation even though the interposed version of glXSwapIntervalEXT() never calls the underlying implementation unless overlay rendering is enabled or the X display is excluded. Because the interposed version of glXGetProcAddress[ARB]() returned NULL for glXSwapIntervalEXT(), Chrome fell back to using EGL/X11, which we don't support yet (refer to #66), and failing to intialize EGL, it disabled GPU acceleration. NOTE: This commit also pre-emptively fixes the same issue with glXSwapIntervalSGI(). Fixes #146
More specific implementation notes: Fortunately, the EGL API cleanly separates all handles to 2D X server objects, so it will be a lot easier to develop an EGL/X11 front end for VirtualGL than it was to develop the existing GLX front end. Since a 3D application must call
|
A bit of a wrinkle: I was under the mistaken impression that EGL window surfaces did not have independent front and back buffers, but in fact, they do. Thus, it will be necessary to emulate EGL windows using FBOs in much the same way that we emulate GLX windows when using the EGL back end. |
Perhaps less wrinkly than I previously thought: Front buffer rendering with EGL window surfaces is only available when using desktop OpenGL (as opposed to OpenGL ES), and it mainly seems to be implemented as a backward compatibility hack for GLX applications that are being ported to EGL. "Back in the day", some 3D applications used front buffer rendering to draw cursors and selection rectangles on top of rendered frames, but this was mainly a performance hack to avoid re-rendering a complex scene every time the mouse moved. With modern GPUs, the usefulness of such a hack is very limited, and even if it is desirable, there are ways to accomplish it without resorting to front buffer rendering ("back in the day", FBOs didn't exist.) The nVidia drivers fully support front buffer rendering with EGL window surfaces, but Mesa seems to silently return a context with |
Progress! The EGL/X11 front end is now working with an EGL/X11 port of glxinfo and glxspheres. |
Things that aren't implemented (yet): - An EGL/X11 equivalent of fakerut (not sure if it's really needed) - Pixmap surfaces - Front buffer/single buffer rendering with window surfaces (but this is only relevant with desktop OpenGL and is a legacy feature) The relevant piglit tests all pass. Closes #66
Implemented and pushed. See commit log for limitations and other notes. The feature is not documented yet (will get to that next week.) |
In the process of looking into #56, I discovered that, because of the following functions:
eglCopyBuffers()
eglCreatePixmapSurface()
eglCreatePlatformPixmapSurface[EXT]()
eglCreateWindowSurface()
eglCreatePlatformWindowSurface[EXT]()
eglGetConfigAttrib()
eglGetDisplay()
eglGetPlatformDisplay[EXT]()
eglGetProcAddress()
eglQueryNativeDisplayNV()
eglQueryNativeWindowNV()
eglQueryNativePixmapNV()
eglTerminate()
EGL can now effectively be used like GLX. I guess that such is necessary for running OpenGL ES applications in a non-mobile environment, but it also creates problems for VirtualGL. Solving those problems the right way would be of similar scope to #43 (Wayland EGL interposer.) It would require duplicating much of the functionality of the GLX interposer-- including new EGL-specific VirtualWin, VirtualPixmap, and VirtualDrawable classes, mapping EGLConfigs to 2D X server visuals (in order to return correct values for
eglGetConfigAttrib(..., EGL_NATIVE_VISUAL_TYPE|EGL_NATIVE_VISUAL_ID, ...)
), hashing EGLDisplay instances to the corresponding 2D X server display string (also because of those native EGLConfig attributes), designing appropriate test programs (EGLspheres), adding appropriate tests to fakerut, handling applications that usedlopen()
to load libEGL, etc. That starts to look like about 30-40 hours of work. Contact me if your organization is interested in funding this project.The justification for this feature is two-fold:
The text was updated successfully, but these errors were encountered: