ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
673 stars 152 forks source link

More verbose Init error message needed #27

Closed MagaTailor closed 7 years ago

MagaTailor commented 7 years ago

I'm trying to find out the state of egl/mali support on an S905 tv box running Ubuntu 16.04 and here's what I get from trying to run glxgears:

odroid@amlogic:~/gl4es$ glxgears
LIBGL: Initialising gl4es
LIBGL: v0.9.7 built on Jun 13 2017 20:22:17
LIBGL:loaded: libGLESv1_CM.so
LIBGL:loaded: libEGL.so
LIBGL: Error while gathering supported extension (Init issue), default to none 
LIBGL: Current folder is:/home/ odroid/gl4es 
LIBGL: Unable to create EGL display. 
Error: glXCreateContext failed

I'm not sure what the issue is about (hope I'm not mixing 32/64 bit code) so the error message could be more helpful.

ptitSeb commented 7 years ago

Wow, "Init issue" is not good. That mean it cannot create a PBuffer context. Looks like there is no GLES 1.1 support at all to me.

Look here: https://github.com/ptitSeb/gl4es/blob/master/src/glx/hardext.c#L78 that error message means it cannot initialize EGL Display...

MagaTailor commented 7 years ago

I expected it was going to be broken, however it's the same chip found in Odroid C2 (I assume ARM64 gl4es is fully usable on that board) so maybe some pieces of the Mali stack are missing.

I'll investigate tomorrow.

ptitSeb commented 7 years ago

gl4es is compatible with 64bits build, and it seems to be working fine on Odroid C2.

Anyway, more detailled EGL error message with commit d71ca21f4b707f75fa3c5f67530fa6d2ce0f7294

Closing the issue.

MagaTailor commented 7 years ago

Thanks, now it provides this info:

(eglInitialize: EGL_BAD_ALLOC)

Any idea if it's about the kernel or the userspace part of the Mali stack?

ptitSeb commented 7 years ago

Well, according to https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglInitialize.xhtml eglInitialize is not supposed to give a EGL_BAD_ALLOC.

And also:

EGL_BAD_ALLOC
EGL failed to allocate resources for the requested operation.
MagaTailor commented 7 years ago

Progress! (see here and here)

So, the output from LIBGL_FB=3 glxgears produces some moving colored sprites:

screenshot at 2017-06-15 15 26 03

The other two FB modes lead to segfaults.