sdl2_frt/src/video
Sam Lantinga 4b585e75d9 Fixed bug 4833 - Use EGL for X11?
Martin Fiedler

To be precise, this is about *desktop OpenGL* on X11. For OpenGL ES, EGL is already used (as it's the only way to get an OpenGL ES context), as Sylvain noted above.

To shine some light on why this is needed:
In 99% of all cases, using GLX on X11 is fine, even though it's effectively deprecated in favor of EGL [1]. However, there's at least one use case that *requires* the OpenGL context being created with EGL instead of GLX, and that's DRM_PRIME interoperability: The function glEGLImageTargetTexture2DOES simply doesn't work with GLX. (Currently, Mesa actually crashes when trying that.)
Some example code:
https://gist.github.com/kajott/d1b29c613be30893c855621edd1f212e
Runs on Intel and open-source AMD drivers just fine (others unconfirmed), but with #define USE_EGL 0 (i.e. forcing it to GLX), it crashes. The same happens when using SDL for window and context creation.

The good news is that most of the pieces for EGL support on X11 are already in place: SDL_egl.c is pretty complete (and used for desktop OpenGL on Wayland, for example), and SDL_x11opengl.c has the aforementioned OpenGL-ES-on-EGL support. However, when it comes to desktop OpenGL, it's hardcoded to fall back to GLX.

I'm not advocating to make EGL the default for desktop OpenGL on X11; don't fix what ain't broken. But something like an SDL_HINT_VIDEO_X11_FORCE_EGL would be very appreciated to make use cases like the above work with SDL.


[1] source: Eric Anholt, major Linux graphics stack developer, 7 years ago already - see last paragraph of https://www.phoronix.com/scan.php?page=news_item&px=MTE3MTI
2020-02-03 08:06:52 -08:00
..
android Android: prevents rare crashes when app goes to background or ends. 2020-01-17 12:41:54 +01:00
arm ARM: NEON assembly optimization for SDL_FillRect 2019-10-24 21:17:52 -04:00
cocoa Miscellaneous pending fixes 2020-01-29 20:09:08 -08:00
directfb Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
dummy Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
emscripten Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
haiku Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
khronos Added Vulkan headers version 1.1.91 2018-11-06 16:57:07 -08:00
kmsdrm Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
nacl Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
offscreen Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
pandora Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
psp Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
qnx Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h 2017-08-28 00:43:14 -07:00
raspberry Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
uikit Fixed build 2020-01-30 14:58:41 -08:00
vivante Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
wayland Fixed bug 4917 - Wayland: handle discrete pointer axis events 2020-02-03 00:57:12 -08:00
windows Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
winrt Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
x11 Fixed bug 4833 - Use EGL for X11? 2020-02-03 08:06:52 -08:00
yuv2rgb Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_0.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_1.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_A.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_auto.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_auto.h Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_copy.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_copy.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_N.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_slow.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_slow.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_bmp.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_clipboard.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_egl_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_egl.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_fillrect.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_pixels_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_pixels.c A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_rect_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_rect.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_RLEaccel_c.h A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_RLEaccel.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_shape_internals.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_shape.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_stretch.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_surface.c A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_sysvideo.h Export SDL functions for iOS application delegates 2020-01-30 14:51:33 -08:00
SDL_video.c video: Added a hint to override the display's usable bounds. 2020-01-27 10:58:30 -05:00
SDL_vulkan_internal.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_vulkan_utils.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_yuv_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_yuv.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
sdlgenblit.pl Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00