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
686 stars 156 forks source link

PrusaSlicer v2.3.0 GL2.0 shader errors #293

Open GlassOnTin opened 3 years ago

GlassOnTin commented 3 years ago

I'm trying to compile PrusaSlicer (a 3D printing slicer) for the Pyra. It requires opengl v2.0 but does run slowly with mesa.

gl4es gives "Error: N" shader errors. What does "N" mean?

The shaders are on github:prusa3d/PrusaSlicer/shaders

LIBGL_STACKTRACE=1 LIBGL_LOGSHADERERROR=1 LIBGL_COMMENTS=1 LD_PRELOAD=~/code/gl4es/lib/libGL.so.1 ./prusa-slicer

LIBGL: Initialising gl4es LIBGL: v1.1.5 built on Mar 27 2021 18:26:17 LIBGL: stacktrace will be printed on crash LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: Using GLES 2.0 backend LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: Extension GL_EXT_draw_buffers 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_multi_draw_arrays detected 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_OES_texture_float detected and used LIBGL: Extension GL_OES_texture_half_float detected and used LIBGL: Extension GL_OES_fragment_precision_high detected and used LIBGL: Extension GL_EXT_shader_texture_lod detected and used LIBGL: Max vertex attrib: 16 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 4096 LIBGL: Max Varying Vector: 8 LIBGL: Texture Units: 8/8 (hardware: 8), Max lights: 8, Max planes: 6 LIBGL: Max Color Attachments: 4 / Draw buffers: 4 LIBGL: Hardware vendor is Imagination Technologies LIBGL: EGLImage to Texture2D supported LIBGL: EGLImage to RenderBuffer supported LIBGL: Targeting OpenGL 2.1 LIBGL: NPOT texture handled in hardware LIBGL: Not trying to batch small subsequent glDrawXXXX LIBGL: try to use VBO LIBGL: FBO workaround for using binded texture enabled LIBGL: Force texture for Attachment color0 on FBO LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done LIBGL: Keep comments in converted Shaders LIBGL: Log to the console Error compiling shaders LIBGL: glX Will try to recycle EGL Surface LIBGL: Current folder is:/home/###/code/PrusaSlicer/build/src DRI3 1.0 present 1.2 DRM FD 7 LIBGL: No EGL configs found. LIBGL: ERROR: EGL Error detected: EGL_BAD_CONFIG [2021-03-27 22:09:29.254051] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'gouraud_light' [2021-03-27 22:09:29.254662] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'printbed' [2021-03-27 22:09:29.254997] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'options_110' [2021-03-27 22:09:29.255363] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'options_120' [2021-03-27 22:09:29.255699] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'toolpaths_lines' [2021-03-27 22:09:29.256127] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'gouraud' [2021-03-27 22:09:29.256462] [0xb4739010] [error] glCreateShader() failed for vertex shader of shader program 'variable_layer_height' LIBGL: FPE Vertex shader compile failed: source is // FPE_Shader generated // Vertex Shader // ligthting=0 (twosided=0, separate=0, color_material=0) // secondary=0, planes=000000 // point=0 varying vec4 Color;

void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; Color = gl_Color; // texturing }

Error is: N LIBGL: FPE Fragment shader compile failed: source is // FPE_Shader generated // Fragment Shader // lighting=0, alpha=0, secondary=0, planes=000000, texturing=0 point=0 varying vec4 Color; void main() { vec4 fColor = Color; gl_FragColor = fColor; }

Error is: N LIBGL: FPE Program link failed: source of vertex shader is // FPE_Shader generated // Vertex Shader // ligthting=0 (twosided=0, separate=0, color_material=0) // secondary=0, planes=000000 // point=0 varying vec4 Color;

void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; Color = gl_Color; // texturing }

source of fragment shader is // FPE_Shader generated // Fragment Shader // lighting=0, alpha=0, secondary=0, planes=000000, texturing=0 point=0 varying vec4 Color; void main() { vec4 fColor = Color; gl_FragColor = fColor; }

Error is: N LIBGL: Stacktrace: 10 /home//code/gl4es/lib/libGL.so.1(+0xf087a)[0xb6efc87a] /lib/arm-linux-gnueabihf/libc.so.6(+0x25ca0)[0xb57feca0] /home//code/gl4es/lib/libGL.so.1(+0x7414e)[0xb6e8014e] /home//code/gl4es/lib/libGL.so.1(+0x75da8)[0xb6e81da8] /home//code/gl4es/lib/libGL.so.1(+0xa4350)[0xb6eb0350] /home//code/gl4es/lib/libGL.so.1(+0x98bf4)[0xb6ea4bf4] /home//code/gl4es/lib/libGL.so.1(+0x6e006)[0xb6e7a006] ./prusa-slicer(+0x5ae774)[0xa49774] ./prusa-slicer(+0x5bbb98)[0xa56b98] /lib/arm-linux-gnueabihf/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler23ProcessEventIfMatchesIdERK21wxEventTableEntryBasePS_R7wxEvent+0x51)[0xb6859e6e] Segmentation fault

GlassOnTin commented 3 years ago

Output from gdb: Thread 1 "slic3r_main" received signal SIGSEGV, Segmentation fault. realize_glenv (ispoint=ispoint@entry=0, first=first@entry=0, count=count@entry=4, type=type@entry=0, indices=indices@entry=0x0, scratch=0xbeffa5ec) at /home//code/gl4es/src/gl/fpe.c:1114 1114 glprogram->texunits[tu_idx].req_tu = GetUniformi(glprogram, glprogram->texunits[tu_idx].id);

ptitSeb commented 3 years ago

The error is this:

LIBGL: No EGL configs found.
LIBGL: ERROR: EGL Error detected: EGL_BAD_CONFIG

It found no EGL config, so no GLES context is created. Eveyrthing else is not relevent, the context is not there. The question is: why can't it create a context? Is there some strange RGBA combinaison asked for the OpenGL context?