Commit 744ac6ec authored by Thomas Guillem's avatar Thomas Guillem

opengl: use GL core symbols from *GetProcAddress

Use GetProcAddress to fetch GL core symbols instead of using symbols from the
libGL linked with the vlc gl plugin (but not for GLES2/Windows/macOS).

This fixes a crash with nvidia drivers when using EGL but can also fix some
others issues if a vendor/distrib ship more than one openGL libs.

cf. https://github.com/NVIDIA/libglvnd/issues/63

Symbols from the old libGL.so.1 were used instead of symbols from the new
libOpenGL.so (that are fetched via eglGetProcAddress()).

I guess that libGL.so.1 can't work with EGL with recent drivers.

Fixes #19093
parent b48244da
...@@ -24,13 +24,13 @@ libglconv_cvpx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' ...@@ -24,13 +24,13 @@ libglconv_cvpx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
if HAVE_OSX if HAVE_OSX
libvout_macosx_plugin_la_SOURCES = video_output/macosx.m $(OPENGL_COMMONSOURCES) libvout_macosx_plugin_la_SOURCES = video_output/macosx.m $(OPENGL_COMMONSOURCES)
libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) libvout_macosx_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) -DHAVE_GL_CORE_SYMBOLS
libvout_macosx_plugin_la_LIBADD = $(OPENGL_COMMONLIBS) libvout_macosx_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \ libvout_macosx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
-Wl,-framework,OpenGL,-framework,Cocoa -Wl,-framework,OpenGL,-framework,Cocoa
libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m $(OPENGL_COMMONSOURCES) libcaopengllayer_plugin_la_SOURCES = video_output/caopengllayer.m $(OPENGL_COMMONSOURCES)
libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) libcaopengllayer_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) -DHAVE_GL_CORE_SYMBOLS
libcaopengllayer_plugin_la_LIBADD = $(OPENGL_COMMONLIBS) libcaopengllayer_plugin_la_LIBADD = $(OPENGL_COMMONLIBS)
libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \ libcaopengllayer_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' \
-Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore -Wl,-framework,OpenGL,-framework,Cocoa,-framework,QuartzCore
...@@ -68,7 +68,11 @@ vout_LTLIBRARIES += $(LTLIBgles2) ...@@ -68,7 +68,11 @@ vout_LTLIBRARIES += $(LTLIBgles2)
libgl_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c libgl_plugin_la_SOURCES = $(OPENGL_COMMONSOURCES) video_output/opengl/display.c
libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) $(OPENGL_COMMONCLFAGS) libgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(GL_CFLAGS) $(OPENGL_COMMONCLFAGS)
libgl_plugin_la_LIBADD = $(GL_LIBS) $(LIBM) $(OPENGL_COMMONLIBS) libgl_plugin_la_LIBADD = $(LIBM) $(OPENGL_COMMONLIBS)
if HAVE_WIN32
libgl_plugin_la_CFLAGS += -DHAVE_GL_CORE_SYMBOLS
libgl_plugin_la_LIBADD += $(GL_LIBS)
endif
libglconv_vaapi_wl_plugin_la_SOURCES = video_output/opengl/converter_vaapi.c \ libglconv_vaapi_wl_plugin_la_SOURCES = video_output/opengl/converter_vaapi.c \
video_output/opengl/converter.h \ video_output/opengl/converter.h \
...@@ -309,7 +313,7 @@ libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \ ...@@ -309,7 +313,7 @@ libglwin32_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid $(OPENGL_COMMONLIBS) libglwin32_plugin_la_LIBADD = libchroma_copy.la -lopengl32 -lgdi32 $(LIBCOM) -luuid $(OPENGL_COMMONLIBS)
libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 $(OPENGL_COMMONLIBS) libwgl_plugin_la_LIBADD = -lopengl32 -lgdi32 $(OPENGL_COMMONLIBS)
libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) libglwin32_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) -DHAVE_GL_CORE_SYMBOLS
libwgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS) libwgl_plugin_la_CFLAGS = $(AM_CFLAGS) $(OPENGL_COMMONCLFAGS)
libglwin32_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libglwin32_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
......
...@@ -738,7 +738,11 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, ...@@ -738,7 +738,11 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl->gl = gl; vgl->gl = gl;
#if defined(USE_OPENGL_ES2) || defined(HAVE_GL_CORE_SYMBOLS)
#define GET_PROC_ADDR_CORE(name) vgl->vt.name = gl##name #define GET_PROC_ADDR_CORE(name) vgl->vt.name = gl##name
#else
#define GET_PROC_ADDR_CORE(name) GET_PROC_ADDR_EXT(name, true)
#endif
#define GET_PROC_ADDR_EXT(name, critical) do { \ #define GET_PROC_ADDR_EXT(name, critical) do { \
vgl->vt.name = vlc_gl_GetProcAddress(gl, "gl"#name); \ vgl->vt.name = vlc_gl_GetProcAddress(gl, "gl"#name); \
if (vgl->vt.name == NULL && critical) { \ if (vgl->vt.name == NULL && critical) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment