Files
LibretroAdmin ae907bff65 libretro: OpenGL contexts for a core's own threads
RETRO_ENVIRONMENT_GET_HW_SHARED_CONTEXT_INTERFACE (104, experimental)
gives an OpenGL or OpenGL ES hardware core contexts in its own
context's share group, for threads of its own: create and destroy on
the core's thread, make_current on the thread that uses one. A core
can then render or compile shaders off its main thread with nothing of
the window system in the core. A frontend that cannot make such
contexts answers false, and the core keeps its GL work on the thread
that calls retro_run.

RetroArch answers it with the context drivers' shared contexts, which
GLX, Wayland and X11 EGL already had for OpenXR; WGL, KMS/DRM and
Android get them here. The WGL one shares with the context current on
the calling thread (the core's), made with the window context's
attributes, and binds on the window's device context.

samples/gfx/gl_shared_context is a core whose second thread clears a
texture through such a context that retro_run then shows; the EGL
hardware core workflow runs it on GLX and EGL, threaded and not, with
a compatibility and a 3.3 core context.
2026-11-12 04:32:16 +01:00
..