libretro/RetroArch — pull request #654 by Themaister (2014-04-19 15:41:09+00:00)
Title: libretro GL shared context support

Currently, libretro GL cores have to be aware that the frontend can potentially change some GL state (shaders, FBOs bound, rasterizer state, vertex arrays, textures bound, etc), this can make it more difficult to port GL code which is not aware of this.

I've implemented an option in RetroArch which allows libretro GL cores to be sandboxed into their own GL context. FBO rendering is done by sharing resources between frontend context and core context. This means a GL context switch when rendering with either RetroArch or core. Doing this doesn't seem to affect performance on my laptop at all.

I've implemented support in GLX, X/EGL, DRM/KMS and WGL context drivers. Adding to other backends should be easy. EGL supports sharing just fine and is mostly boilerplate copypasta across the context drivers.

Currently, video_shared_context = true enables this.