chjj / compton

A compositor for X11.
Other
2.25k stars 501 forks source link

EGL back end? #276

Open tux1c opened 9 years ago

tux1c commented 9 years ago

I tried searching but found nothing on my matter.

I am using Compton on my TF201 which has the Tegra 3 GPU. As far as I understood, the Tegra 3 has no GLX support (I looked it up online + glxinfo tells me Mesa handles GLX), and when I tried using GLX as back end, obviously, things were very slow.

I am currently using X Rander, but I wanted to ask / request, is there a way to use EGL as back end? If not, is there any chance for it to be implemented in Compton? If not, could you recommend me a compositing manager that does have (although that'd a shame, as I use Compton on all of my machines)

ljrk0 commented 9 years ago

+1 on this. But I suppose this is rather a difficult step as this would add another backend.

But it would definitely be a nice improvement as now the nVidia proprietary driver (for GeForce etc.) is also supporting EGL.

kelleyk commented 9 years ago

(This is mostly me thinking out loud as I looked into what this would involve.)

To summarize, nothing jumps out at me as making the task particularly difficult. It would mostly be translating one API to the other. The largest single job would be removing the use of OpenGL immediates, I think.


compton uses both gl and glx.

It can, optionally, use GL_EXT_gpu_shader4 if available. It does not appear to use other gl extensions (i.e. no other GL_EXT_* symbols appear in the sources). It uses GLX_EXT_texture_from_pixmap and GLX_EXT_buffer_age.

Here is a rough list of symbols used by compton:

glActiveTexture
glAttachShader
glBegin
glBindFramebuffer
glBindTexture
glBitmap
glBlendFunc
glCheckFramebufferStatus
glClear
glClearColor
glClientWaitSync
glColor4f
glColorMask
glCompileShader
glCopyPixels
glCopyTexSubImage2D
glCreateProgram
glCreateShader
glDebugMessageCallback
glDeleteFramebuffers
glDeleteProgram
glDeleteShader
glDeleteSync
glDeleteTextures
glDepthMask
glDetachShader
glDisable
glDrawBuffers
glEnable
glEnd
glext
glFenceSync
glFinish
glFlush
glFramebufferTexture2D
glGenFramebuffers
glGenTextures
glGetError
glGetFloatv
glGetIntegerv
glGetProgramInfoLog
glGetProgramiv
glGetShaderInfoLog
glGetShaderiv
glGetString
glGetUniformLocation
glIsEnabled
glIsSync
glLinkProgram
glLoadIdentity
glLogicOp
glMatrixMode
glMultiTexCoord2f
glOrtho
glPixelStorei
glPointSize
glRasterPos2f
glRasterPos4fv
glReadBuffer
glReadPixels
glScissor
glShaderSource
glStencilFunc
glStencilMask
glStencilOp
glTexCoord2f
glTexEnvf
glTexEnvi
glTexImage2D
glTexParameteri
glUniform1f
glUniform1i
glUseProgram
glVertex3f
glVertex3i
glViewport
glWaitSync
glXCopySubBufferMESA
glXCreateContext
glXCreateContextAttribsARB
glXCreatePixmap
glXDestroyContext
glXDestroyPixmap
glXGetConfig
glXGetFBConfigAttrib
glXGetFBConfigs
glXGetProcAddress
glXGetSyncValuesOML
glXGetVideoSyncSGI
glXGetVisualFromFBConfig
glXMakeCurrent
glXQueryDrawable
glXQueryExtension
glXQueryExtensionsString
glXReleaseTexImageEXT
glXSwapBuffers
glXSwapIntervalSGI
glXWaitX