Errors on Rock64
So far so good but certain things fail
With LIBGL_FB=0 ffplay works in window but not in fullscreen (Block in topleft - surface seems to be there because cant access desktop) LIBGL_FB=3 works both Windowed and Fullscreen
Running mythtv get LIBGL: FPE Vertex shader compile failed: $&�� LIBGL: FPE Fragment shader compile failed: $&�� LIBGL: FPE Program link failed: $&��
I haven't tried mythtv yet, but I guess the shader it created are not convered properly...
Can you run it with LIBGL_LOGSHADERERROR=1 LIBGL_COMMENTS=1 to have more detail about the shaders that don't compile (also, strange that the error message is just garbage).
For the fullscreen issue with LIBGL_FB=0, there is not much I can do, I guess the issue is in the egl driver and it's interaction with X11. Hopefully LIBGL_FB=3 doesn't introduce too much slow down (or no slowdown at all compared to LIBGL_FB=0).
MythTV does seem to have its own problems - at least the current git version. When I select GLES1.5 it gets further but fails with
2018-09-25 22:40:03.424096 I Trying the OpenGL 1.2 render 2018-09-25 22:40:03.432266 I OpenGL painter using existing OpenGL context. QEGLPlatformContext: Failed to create context: 3009 2018-09-25 22:40:03.562902 E OpenGL: Init an invalid context. Missing call to setWidget or create?
I suspect MythTv is using GL VIa QT and the QT Lib is possibly not honouring LD_LIBRARY_PATH, (Hardwired to a particular GL Lib) which either isn't there or is not working. Interestingly it calls QT EGL which perhaps opens the door to using EGL rather than GL4ES. This is backed up by the fact that making GL4ES libGL unavailable results in exactly the same behaviour. I think this might be a QT issue. I am continuing to look into it.
(I Havent got GL4ES libGL enabled in the system directories for safety reasons)
On the Fullscreen issue, I don't think this is likely to be the problem, other EGL only apps work fine in fullscreen, What is the difference between FB=0 and 3?
For Qt, it is possible your QtOpenGL is compiled for GLES2. You probably need to build it for Desktop OpenGL for this to work (it's always build for GLES2 on ARM platforms). Also, it probably try to open libGLESv2.so, and that will somehow conflict with libGL.so because most functions name are common.
On the Fullscreen issue, with LIBGL_FB=0, the egl context is created in a regular way, using current eglDisplay and with the X11 Window gave in parameter in the glX functions. With LIBGL_FB=3, the egl context created is a XPixMap (if available) or PBuffer (as a fallback). Then, at the swapbuffer, a simple eglSwapbuffers(...) is called for LIBGL_FB=0 where it will be a full blit with LIBGL_FB=3.
Here is the error log for the V2 Shader error IBGL: Error while compiling shader 6. Original source is: #version 110 #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect s_texture0; varying vec4 v_color; varying vec2 v_texcoord0; void main(void) { gl_FragColor = texture2DRect(s_texture0, v_texcoord0) * v_color; }
======= ShaderConv Source is: #version 100 precision mediump float; precision mediump int;
#extension GL_ARB_texture_rectangle : enable uniform sampler2DRect s_texture0; varying vec4 v_color; varying vec2 v_texcoord0; void main(void) { gl_FragColor = texture2DRect(s_texture0, v_texcoord0) * v_color; }
======= Compiler message is 0:5: P0007: Extension directive must occur before any non-preprocessor tokens 0:6: L0001: Typename expected, found 'sampler2DRect'
LIBGL: End of Error log
If I Set GL version 1.5 I get a similar but different failure
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 // texture=00000001, point=0 varying vec4 Color; varying vec2 _gl4es_TexCoord_0;
void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
Color = gl_Color;
// texturing
// texture 0 active: 1
_gl4es_TexCoord_0 = gl_MultiTexCoord0.xy / gl_MultiTexCoord0.q;
}
Error is: ��� LIBGL: FPE Fragment shader compile failed: source is // FPE_Shader generated // ** Fragment Shader ** // lighting=0, alpha=0, secondary=0, planes=000000, textype=00000001, texformat=00000000 point=0 varying vec4 Color; varying vec2 _gl4es_TexCoord_0; uniform sampler2D _gl4es_TexSampler_0; void main() { vec4 fColor = Color; vec4 texColor0 = texture2D(_gl4es_TexSampler_0, _gl4es_TexCoord_0); // Texture 0 active: 1, texenv=0, format=0 fColor *= texColor0; gl_FragColor = fColor; }
Error is: ��� 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 // texture=00000001, point=0 varying vec4 Color; varying vec2 _gl4es_TexCoord_0;
void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
Color = gl_Color;
// texturing
// texture 0 active: 1
_gl4es_TexCoord_0 = gl_MultiTexCoord0.xy / gl_MultiTexCoord0.q;
}
source of fragment shader is // FPE_Shader generated // ** Fragment Shader ** // lighting=0, alpha=0, secondary=0, planes=000000, textype=00000001, texformat=00000000 point=0 varying vec4 Color; varying vec2 _gl4es_TexCoord_0; uniform sampler2D _gl4es_TexSampler_0; void main() { vec4 fColor = Color; vec4 texColor0 = texture2D(_gl4es_TexSampler_0, _gl4es_TexCoord_0); // Texture 0 active: 1, texenv=0, format=0 fColor *= texColor0; gl_FragColor = fColor; }
Error is: ���
Thread 1 "mythfrontend" received signal SIGSEGV, Segmentation fault.
realize_glenv (ispoint=
Also glDeleteQueriesARB is undefined?
Hmm I notice there are no ARB Wrappers in queries.c
So. For the "v2" shader, it use textureRectangle stuff, that's not supported yet, so the faillure is normal. Support for those is on my todo...
The faillure on the v1.5 is not normal. It seems no shader actually compile, like if the context is not set properly. Is there some errors, in the beggigning on the app, stating that EGL has found any config or something like that?
The ARB wrapper to queries, yes, I can add that. But remember these function are dummies and have 0 bits of precisions. What app needs that?
OK,
I Added the ARB queries myself to get past the link error, that went OK. Clear this up for me, doesn't the wrapper pass through the arguments to GLES equivalent function unaltered. Why then are they useless?
The Converted Shaders have
#version 100 precision mediump float; precision mediump int;
#extension GL_ARB_texture_rectangle : enable
These error out saying that the directives should precede the code IE Compiler message is 0:5: P0007: Extension directive must occur before any non-preprocessor tokens 0:6: L0001: Typename expected, found 'sampler2DRect'
So the two precision lines need to come after #extensions, even though some things aren't implemented this might need to be fixed. Maybe its that way for another reason? I don't understand the code yet. *The GLES Shader spec does suggest directives come before code.
I think the failure on the 1.5 shaders in mythtv is from a misset LIBGL_GL value. I fixed it and no more segfault - But the windows that gets rendered is Empty.
In the History I get 018-10-04 17:33:17.988641 I Trying the OpenGL 1.2 render 2018-10-04 17:33:17.988999 I OpenGL painter using existing OpenGL context. QEGLPlatformContext: Failed to create context: 3009 2018-10-04 17:33:18.128028 E OpenGL: Init an invalid context. Missing call to setWidget or create?
And I think this is the cause of the hollow window - Myth TV Passes a bad EGL Context to ES4GL, I need to debug that problem first I think
kodi just generates a Black fullscreen window so at least it goes a little way, but it would be nice if it emitted some diagnostics ...
For the QueriesARB: these functions just don't exist in GLES, so there is nothing to wrap (also, gl4es is now more then a simple wrapper, there are a lot of stuff happening behind the scene). I'll add the ARB functions, if you had a link error, then it's clearly needed (or youc an do a PR if you want).
For the shader, yes, the #extension should be before the other stuff, and this is not handled correctly yet. I'll try to add something to handle that in the code. But that will not fix the issue because texture2DRect and sampler2DRect are not supported in shaders for now (that will require some work, and I'll probably work on that with version 1.1.1).
For the 1.x version, yeah, the EGL stuff seems to conflict somehow. Not sure how, because the EGL context should be an ES2 context that Qt shoul dbe able to use (using LIBGL_GL=15 LIBGL_ES=2 exports)