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
696 stars 159 forks source link

Problems on planet computers gemini #75

Closed static-void closed 5 years ago

static-void commented 5 years ago

Hello! I have built this on debian for the gemini, and I have some issues. All settings of LIBGL_FB options except for LIBGL_FB=3 result in a segfault (in libX11.so.6 XGetVisualInfo). LIBGL_FB=3 works but is very slow, for glxgears it gets about 70fps with the default window size, and 3 or 4 fps in fullscreen. With glshim it's more like 250 to 300 windowed and around 220 in fullscreen. I guess this is because with LIBGL_FB=3 implies copying buffers to screen and the resolution is quite high. I have tried the ES 1 backend, and various other options and build options. At present I am building with simply "cmake ..", but using one of the other targets does not make any difference.

I should mention that I don't quite know what is at fault here, because debian on the gemini uses libhybris and xf86-video-hwcomposer, which is a somewhat unique configuration I think.

I have built a debug version, but I think the stack is corrupt:


gemini@localhost:~/project/gl4es2/build/lib$ LD_LIBRARY_PATH=. LIBGL_STACKTRACE=1 gdb glxinfo
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from glxinfo...(no debugging symbols found)...done.
(gdb) r 
Starting program: /usr/bin/glxinfo 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
LIBGL: Initialising gl4es
LIBGL: v1.1.1 built on Dec 14 2018 15:29:02
LIBGL: stacktrace will be printed on crash
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so.1
LIBGL: Using GLES 2.0 backend
library "libwlparser.so" not found
[New Thread 0x7fb54a41e0 (LWP 15448)]
[New Thread 0x7fb4ca41e0 (LWP 15449)]
[New Thread 0x7fb44a41e0 (LWP 15450)]
[New Thread 0x7fb3ca41e0 (LWP 15451)]
[New Thread 0x7fb34a41e0 (LWP 15452)]
[New Thread 0x7fb2ca41e0 (LWP 15453)]
[New Thread 0x7fb24a41e0 (LWP 15454)]
[New Thread 0x7fb1ca41e0 (LWP 15455)]
[New Thread 0x7fb14a41e0 (LWP 15456)]
[New Thread 0x7fb0ca41e0 (LWP 15457)]
[New Thread 0x7fb04a41e0 (LWP 15458)]
[New Thread 0x7fafca41e0 (LWP 15459)]
[New Thread 0x7faf4a41e0 (LWP 15460)]
[New Thread 0x7faec841e0 (LWP 15461)]
[New Thread 0x7fae4841e0 (LWP 15462)]
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 8192
LIBGL: Max Varying Vector: 15
LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6
[Thread 0x7faec841e0 (LWP 15461) exited]
LIBGL: Hardware vendor is ARM
LIBGL: Targeting OpenGL 2.0
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/gemini/project/gl4es2/build/lib
name of display: :0

Thrad 1 "glxinfo" received signal SIGSEGV, Segmentation fault.
0x0000007fb7bc09c0 in XGetVisualInfo () from /usr/lib/aarch64-linux-gnu/libX11.so.6
(gdb) bt
#0  0x0000007fb7bc09c0 in XGetVisualInfo () from /usr/lib/aarch64-linux-gnu/libX11.so.6
#1  0x0000007fb705ef48 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 
#0  0x0000007fb7bc09c0 in XGetVisualInfo () from /usr/lib/aarch64-linux-gnu/libX11.so.6
#1  0x0000007fb705ef48 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)```
ptitSeb commented 5 years ago

Strange, there is no call to XGetVisualInfo in gl4es itself. Still, the way gl4es create the context doesn't seems to work here. Can you uncomment line 36 of src/glx/glx.c and make a run again. The glX call will be dumped, that should help pinpoint the issue.

static-void commented 5 years ago

Yep, I get this:


LIBGL: Initialising gl4es
LIBGL: v1.1.1 built on Dec 14 2018 15:29:02
LIBGL: stacktrace will be printed on crash
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so.1
LIBGL: Using GLES 2.0 backend
library "libwlparser.so" not found
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used 
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 8192
LIBGL: Max Varying Vector: 15
LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6
LIBGL: Hardware vendor is ARM
LIBGL: Targeting OpenGL 2.0
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/gemini/project/gl4es2/build/lib
glXChooseVisual(0x7cb447c8f0, 0, 0x7fd4777198)
glXChooseFBConfig(0x7cb447c8f0, 0, 0x7fd4776f50, 0x7fd4776f4c)
FBConfig doubleBufferMode=1
FBConfig redBits=1
FBConfig greenBits=1
FBConfig blueBits=1
FBConfig depthBits=1
LIBGL: Stacktrace: 3
./libGL.so.1(+0xe4138)[0x7c9bbf3138]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x7c9bdce4e0]
/usr/lib/aarch64-linux-gnu/libX11.so.6(XGetVisualInfo+0x28)[0x7c9b9759c0]
Segmentation fault (core dumped)```
ptitSeb commented 5 years ago

So I would say it's line 1709 of src/glx/glx.c that caused the crash. Can you add a printf of somthing before and after this line just to be sure.

static-void commented 5 years ago

I put printfs around it but neither prints :(

static-void commented 5 years ago

Just to check: I don't need glues do I? (Not currently using it) (Also, I am not using https://github.com/ptitSeb/GLU)

ptitSeb commented 5 years ago

GLU can be needed for some software and games, but not for glxgears.

Also, I made a mistake, and it's more probably line 1632 unless it's line 1666.

static-void commented 5 years ago

To check, these are all egl_eglChooseConfig calls right? I put printfs around both, it prints them all and then prints "LIBGL: Stacktrace: 3" and then crashes

ptitSeb commented 5 years ago

Line 1666 is something else, it's fillGLXFBConfig call... I was thinking maybe the line 1472 with egl_eglGetConfigAttrib(eglDisplay, eglConfigs[i], EGL_NATIVE_VISUAL_ID, &configs[j]->associatedVisualId); ... or line 1477 with the XMatchVisualInfo(display, 0, glx_default_depth, TrueColor, &visual);

static-void commented 5 years ago

Alright, now it ends:

FBConfig doubleBufferMode=1
1632 before egl_eglChosseConfig
after egl_eglChooseConfig
1666 before fillGLXFBConfig
1472 before egl_eglGetConfigAttrib
LIBGL: Stacktrace: 3
<crash>
ptitSeb commented 5 years ago

Ah good.

And if you comment line 1472?

static-void commented 5 years ago
LIBGL: Initialising gl4es
LIBGL: v1.1.1 built on Dec 14 2018 15:29:02
LIBGL: stacktrace will be printed on crash
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so.1
LIBGL: Using GLES 2.0 backend
library "libwlparser.so" not found
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 8192
LIBGL: Max Varying Vector: 15
LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6
LIBGL: Hardware vendor is ARM
LIBGL: Targeting OpenGL 2.0
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/gemini/project/gl4es2/build/lib
glXChooseVisual(0x72044648f0, 0, 0x7fe73f4958)
glXChooseFBConfig(0x72044648f0, 0, 0x7fe73f4710, 0x7fe73f470c)
FBConfig doubleBufferMode=1
FBConfig redBits=1
FBConfig greenBits=1
FBConfig blueBits=1
FBConfig depthBits=1
1632 before egl_eglChooseConfig
after egl_eglChooseConfig
1666 before fillGLXFBConfig
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
after fillGLXFBConfig
glXChooseFBConfig found 14 config
glXCreateContext(0x72044648f0, 0x72043fd700, (nil), 1), latest_visual=0x72043fd700, fbcontext_count=0Creating R:8 G:8 B:8 A:0 Depth:24 Stencil:8 Multisample:0/0
 => 0x72044035c0
 glXMakeCurrent(0x72044648f0, 0x2400002, 0x72044035c0), isPBuffer(drawable)=0, context->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=1
 Aborted (core dumped)
 BGL: Initialising gl4es
 LIBGL: v1.1.1 built on Dec 14 2018 15:29:02
 LIBGL: stacktrace will be printed on crash
 LIBGL: Using GLES 2.0 backend
 LIBGL: loaded: libGLESv2.so
 LIBGL: loaded: libEGL.so.1
 LIBGL: Using GLES 2.0 backend
 library "libwlparser.so" not found
 LIBGL: Hardware Full NPOT detected and used
 LIBGL: Extension GL_EXT_blend_minmax detected and used
 LIBGL: FBO are in core, and so used
 LIBGL: PointSprite are in core, and so used
 LIBGL: CubeMap are in core, and so used
 LIBGL: BlendColor is in core, and so used
 LIBGL: Blend Substract is in core, and so used
 LIBGL: Blend Function and Equation Separation is in core, and so used
 LIBGL: Texture Mirrored Repeat is in core, and so used
 LIBGL: Extension GL_OES_mapbuffer detected
 LIBGL: Extension GL_OES_element_index_uint detected and used
 LIBGL: Extension GL_OES_packed_depth_stencil detected and used
 LIBGL: Extension GL_OES_depth24 detected and used
 LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
 LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
 LIBGL: Extension GL_OES_depth_texture detected and used
 LIBGL: Extension GL_EXT_texture_rg detected and used
 LIBGL: Extension GL_EXT_color_buffer_float detected and used
 LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
 LIBGL: high precision float in fragment shader available and used
 LIBGL: Max vertex attrib: 16
 LIBGL: Extension GL_OES_standard_derivatives detected and used
 LIBGL: Max texture size: 8192
 LIBGL: Max Varying Vector: 15
 LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6
 LIBGL: Hardware vendor is ARM
 LIBGL: Targeting OpenGL 2.0
 LIBGL: glXMakeCurrent FBO workaround enabled
 LIBGL: FBO workaround for using binded texture enabled
 LIBGL: glX Will try to recycle EGL Surface
 LIBGL: Current folder is:/home/gemini/project/gl4es2/build/lib
 glXChooseVisual(0x72044648f0, 0, 0x7fe73f4958)
 glXChooseFBConfig(0x72044648f0, 0, 0x7fe73f4710, 0x7fe73f470c)
 FBConfig doubleBufferMode=1
 FBConfig redBits=1
 FBConfig greenBits=1
 FBConfig blueBits=1
 FBConfig depthBits=1
 1632 before egl_eglChooseConfig
 after egl_eglChooseConfig
 1666 before fillGLXFBConfig
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 1472 before egl_eglGetConfigAttrib
 after egl_eglGetConfigAttrib
 1477 before XMatchVisualInfo
 after XMatchVisualInfo
 after fillGLXFBConfig
 glXChooseFBConfig found 14 config
 glXCreateContext(0x72044648f0, 0x72043fd700, (nil), 1), latest_visual=0x72043fd700, fbcontext_count=0Creating R:8 G:8 B:8 A:0 Depth:24 Stencil:8 Multisample:0/0
  => 0x72044035c0
  glXMakeCurrent(0x72044648f0, 0x2400002, 0x72044035c0), isPBuffer(drawable)=0, context->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=1
  Aborted (core dumped)
ptitSeb commented 5 years ago

Mmmm, so still crashes?

And with LIBGL_FB=1?

static-void commented 5 years ago

It looks identical :( Actually not quite, it only tries once. I will dump it but got kids to get to bed for the next 2 hours or so

ptitSeb commented 5 years ago

Ok. So it must be something on the init of EGL that makes it freaks out when trying to interact with X11.

And glshim works?

static-void commented 5 years ago

Yeah glshim works perfectly. I mean, it appears to have no env variables to configure it, and I don't know what FB rendering method it uses, but it's much faster

ptitSeb commented 5 years ago

Much faster than LIBGL_FB=3 sure. glshim use LIBGL_FB=0 by default, and silently fallback to LIBGL_FB=1 if that fail. But the init phase is very different now.

If you use LIBGL_NOTEST=1 you still have the same issue?

static-void commented 5 years ago

Here's the output with LIBGL_FB=1

gemini@localhost:~/project/gl4es2/build/lib$ LD_LIBRARY_PATH=. LIBGL_STACKTRACE=1 LIBGL_FB=1 glxgears
LIBGL: Initialising gl4es
LIBGL: v1.1.1 built on Dec 14 2018 15:29:02
LIBGL: stacktrace will be printed on crash
LIBGL: framebuffer output enabled
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so.1
LIBGL: Using GLES 2.0 backend
library "libwlparser.so" not found
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 8192
LIBGL: Max Varying Vector: 15
LIBGL: Texture Units: 8(8), Max lights: 8, Max planes: 6
LIBGL: Hardware vendor is ARM
LIBGL: Targeting OpenGL 2.0
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: FBO workaround for using binded texture enabled
LIBGL: Current folder is:/home/gemini/project/gl4es2/build/lib
glXChooseVisual(0x783fe7c8f0, 0, 0x7febed8798)
glXChooseFBConfig(0x783fe7c8f0, 0, 0x7febed8550, 0x7febed854c)
FBConfig doubleBufferMode=1
FBConfig redBits=1
FBConfig greenBits=1
FBConfig blueBits=1
FBConfig depthBits=1
1632 before egl_eglChooseConfig
after egl_eglChooseConfig
1666 before fillGLXFBConfig
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
1472 before egl_eglGetConfigAttrib
after egl_eglGetConfigAttrib
1477 before XMatchVisualInfo
after XMatchVisualInfo
after fillGLXFBConfig
glXChooseFBConfig found 14 config
glXCreateContext(0x783fe7c8f0, 0x783fe15700, (nil), 1), latest_visual=0x783fe15700, fbcontext_count=0Creating R:8 G:8 B:8 A:0 Depth:24 Stencil:8 Multisample:0/0
 => 0x783fe1b5c0
 glXMakeCurrent(0x783fe7c8f0, 0x2400002, 0x783fe1b5c0), isPBuffer(drawable)=0, context->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=1
 Aborted (core dumped)
static-void commented 5 years ago

With LIBGL_NOTEST=1 and LIBGL_FB=1 it is identical to my last post

BUT with LIBGL_NOTEST=1 and LIBGL_FB=0 it works! 290ish fps windowed at default size!

ptitSeb commented 5 years ago

Also, can you add in line 342, just after static int InitEGL(Display *display) { this printf: printf("InitEGL(%p), eglInitalized=%d\n"), display, eglInitialized);

static-void commented 5 years ago

Fullscreen, about 220 fps, but still in debug mode ATM with the commented line.

Ouput of that printf is: InitEGL(0x7f84a56ac0), eglInitialized=0

When its not working (LIBGL_NOTEST=0): InitEGL(0x753ad9a500), eglInitialized=0

But I'm guessing the address space randomisation is on, so you need the whole output? Will get back to you, got to go bath a toddler...

ptitSeb commented 5 years ago

Ah interesting! So it's the hardware test at first, that is done on an offscreen pbuffer, that messed up with the rest. I'll see if I can fix that (because hardware test is still something usefull).

static-void commented 5 years ago

I will test with the original line uncommented again as well when I get back

ptitSeb commented 5 years ago

In src/glx/hardext.c line 300, just before the } final, can you add

    LOAD_EGL(eglTerminate);
    egl_eglTerminate(eglDisplay);

To see if you can use it without LIBGL_NOTEST=1

NotKit commented 5 years ago

@ptitSeb I think that is a bug in libhybris X11 EGL platform: https://github.com/NotKit/libhybris/blob/x11/hybris/egl/platforms/x11/eglplatform_x11.cpp#L195. Would eglGetConfigAttrib be invoked during offscreen test for EGL_NATIVE_VISUAL_ID without X11 display?

ptitSeb commented 5 years ago

No, but I noticed that I don't call "eglTerminate" with the offscreen context, that why I asked you to try to close it in https://github.com/ptitSeb/gl4es/issues/75#issuecomment-447419251 (it's just a test, I'll do properly if it work)

static-void commented 5 years ago

Uncommented 1472 and added the two new lines to GetHardwareExtensions, and it works well with FB=0 and NOTEST=0. FB=1 still non-working.

static-void commented 5 years ago

BTW I've noticed glxgears rendering pauses when it prints out the fps, I am not sure if this is an issue of glxgears or not ... doesn't happen on my laptop but then it is much more powerful and doing ~12k fps

ptitSeb commented 5 years ago

the fps stuff, yeah, it's probably better to redirect in a file to avoid console writing and so triggering some X11 drawinf that may interfere with GLES drawing...

I'll will do a clean version of the "close egl context used for hardware testing"

ptitSeb commented 5 years ago

Also, FB=1 is a mode to by pass X11. Not all drivers are able to use it, so no issue if you cannot.

static-void commented 5 years ago

I thought I'd read that somewhere about FB=1. Thanks for tracking this down, you are providing an incredible level of support! :D

ptitSeb commented 5 years ago

Thanks :)

I have just push commit 5cca292ca364118c0f1dfa7210a1d84efa9ba316 with the proper fix.

I'll let you close the ticket once you confirm it work (hopefully, it will).

Nice to see gl4es on more hardware. (I have seen a gemini, running the default linux distrib, last summer, and found it quite slow, mainly due to the hi-res screen, so it's nice to see 200+ fps on glxgears.)

static-void commented 5 years ago

Fix works perfectly, all that's needed to make things work now is LD_LIBRARY_PATH.

I think possibly quite a lot of work has gone in since you last saw it. @NotKit (above) is mostly responsible for the improvement in drivers etc I believe.

Interestingly glxgears is now pushing quite a lot more fps than es2gears, but they are no direct comparison so can't read too much into it. Time to try out some games...

BTW any plans to extend to later OGL versions?

Thanks again :)

ptitSeb commented 5 years ago

Yeah, the version of the Gemini I used obviously had some software blitting for X11, so some window movement where quite slow.

OGL, yes, I have plan to connect to GLES3+ and try to be compatible with OGL 3.x. But I'm not there yet. I first have to add support for GL_TEXTURE_RECTANGLE and GL_TEXTURE_3D is shaders (and GL_TEXTURE_1D also), add support for 1 shader (vertex or fragment) without the other, and maybe also add support for old style shaders (used in Quake3 and friend). Also, I need to redo some port of the EGL/GLES loading before trying to move to GLES3... But yeah, I have plans to further enhance gl4es.

If you try some debian games, Neverball/Neverputt should be plug'n play. Same for foobillard++. If you try TORCS, I suggest you use LIBGL_BATCH=10 for a nice boost in fps. VDrift should also run (but I don't remember if it's debian repo).