aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

Missing egl/gl function

Sat Jul 27, 2019 12:36 am

Using the Pi4 ( I don't have this issue with the Pi3 using the legacy driver and libs)

The new v3d driver reports that the extension GL_OES_EGL_image_external extension is available and that should allow the use of the glEGLImageTargetTexture2DOES function but I'm having some linker problems.

The function glEGLImageTargetTexture2DOES does exist in the gl2ext.h file but the function symbol when trying to link against libEGL or libGLESv2 (not the libs in /opt/vc since I'm using the new driver) is missing which causes a compile linker error.

glEGLImageTargetTexture2DOES symbol is missing from the libEGL.so or libGLESv2.so. I did a list symbols (nm) check to make sure that the symbol was missing which it is. It exist in the lib files in /opt/vc/lib/ but those are for the legacy driver I think.

Is it just not all functionality has been ported to the new driver/libs? I believe I can still handle what I want to do without it but it would make things easier to be able to use a function that seems like it should be supported.

Code: Select all

Here's a print out of all supported extensions for egl and opengl when using opengl es 3.0.

Vendor: Mesa Project
Client APIs: OpenGL OpenGL_ES
Version: 1.4
------EGL Extensions-----------
EGL_CHROMIUM_sync_control EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap

Vendor: Broadcom
Client APIs: V3D 4.2
Version: OpenGL ES 3.0 Mesa 19.1.0-devel
-------GL Extensions-----------
GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments [b]GL_OES_EGL_image_external[/b] GL_OES_EGL_sync GL_OES_vertex_array_object GL_EXT_occlusion_query_boolean GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_integer_mix GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_OES_texture_stencil8 GL_EXT_float_blend GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_MESA_shader_integer_functions GL_KHR_parallel_shader_compile GL_EXT_texture_query_lod

aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

Re: Missing egl/gl function

Tue Jul 30, 2019 5:09 am

I made the mistake of linking against libGLESv2.so instead of libGL.so. I didn't think I would be able to get opengl es 3.0 using that lib file.

jdonald
Posts: 440
Joined: Fri Nov 03, 2017 4:36 pm

Re: Missing egl/gl function

Tue Jul 30, 2019 6:46 am

Whoa, I wasn't expecting to see all those OES functions in libGL.so.

I had read somewhere that GLES3 functions should be exported in libGLESv2.so, yet at the same time I recall working with a libGLESv3.so on Android.

Just found the Khronos Implementers Guide:: Recommended Library Names. Note the footnote [f] at the bottom. It really should be libGLESv2.so but alas Mesa has taken that merely as a guideline.

aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

Re: Missing egl/gl function

Tue Jul 30, 2019 2:43 pm

Using libGLESv2.so will show the same extensions but the issue is that a few of the egl/gl function symbols are missing from libGLESv2.so
but exist in the libGL.so. So when the program tries to link you end up with a compile error because it didn't see a particular function.

User avatar
dividuum
Posts: 225
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Missing egl/gl function

Thu Aug 08, 2019 11:44 am

I'm using GL without X and use DRM directly. I also ran into this issue. I'm linking with -lGLESv2 -lEGL. Regardless of that, the call to eglGetPlatformDisplay seems to dynamically load libEGL_mesa.so.0 (after consulting /usr/share/glvnd/egl_vendor.d/50_mesa.json). So even without explicitly linking, the symbols are available and I've used eglGetProcAddress to resolve them at runtime.

I want to avoid using or depending on X11. It looks like libGL.so depends on a few X11 libs:

Code: Select all

root@raspberrypi:~# ldd /usr/lib/arm-linux-gnueabihf/libGL.so
        [some irrelevant .so snipped for brevity]
        libGLX.so.0 => /usr/lib/arm-linux-gnueabihf/libGLX.so.0 (0xb6e89000)
        libGLdispatch.so.0 => /usr/lib/arm-linux-gnueabihf/libGLdispatch.so.0 (0xb6df8000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb6b4b000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0xb6b2c000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb6afd000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb6aea000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb6ad5000)
My guess would be that linking to libGL.so directly also pulls in libGL_mesa libEGL_mesa and a quick strace on the X11 based drm_mmal implementation seems to confirm this. So the result should be the same?
Last edited by dividuum on Thu Aug 08, 2019 2:34 pm, edited 1 time in total.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

aire39
Posts: 29
Joined: Sat Sep 23, 2017 10:43 am

Re: Missing egl/gl function

Thu Aug 08, 2019 2:04 pm

yes, I didn't take a close enough look at eglGetProcAddress which could also grab opengles functions as well. I just didn't have much of an issue with it since I was running the application headless anyway and I didn't have a need to make X function calls.

as far as libGL_mesa.so I don't see that being included. I see libEGL_mesa.so being included not matter what and I just tried a couple of combinations.

libEGL, libGL
libEGL, libGLESv2
libX11, libEGL, libGL
libX11, libEGL, libGLESv2

with the exception of possibly not wanting to use X. They all load libEGL_mesa.so but I didn't see any of the combinations load libGL_mesa.so lib at least on my pi4.

User avatar
dividuum
Posts: 225
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Missing egl/gl function

Thu Aug 08, 2019 2:33 pm

aire39 wrote:
Thu Aug 08, 2019 2:04 pm
They all load libEGL_mesa.so but I didn't see any of the combinations load libGL_mesa.so lib at least on my pi4.
Right. You're correct. I meant libEGL_mesa.so, not libGL_mesa.so. I've fixed my previous post. I've yet to understand how all those GL lib play together on the Pi4.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

Return to “OpenGLES”