From 90e5cffab8f3627d26e01140d5f413b923596008 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 8 Feb 2015 18:39:12 +0100 Subject: [PATCH] Add RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT --- apple/common/apple_gfx_context.c.inl | 7 +++++++ dynamic.c | 12 ++++++++++++ gfx/drivers/exynos_gfx.c | 3 ++- gfx/drivers/gl.c | 10 +++++++++- gfx/drivers/gx_gfx.c | 2 ++ gfx/drivers/psp1_gfx.c | 2 ++ gfx/drivers/sdl2_gfx.c | 3 ++- gfx/drivers_context/androidegl_ctx.c | 11 +++++++++++ gfx/drivers_context/bbqnx_ctx.c | 9 +++++++++ gfx/drivers_context/d3d_ctx.cpp | 1 + gfx/drivers_context/drm_egl_ctx.c | 10 ++++++++++ gfx/drivers_context/gfx_null_ctx.c | 1 + gfx/drivers_context/glx_ctx.c | 10 ++++++++++ gfx/drivers_context/mali_fbdev_ctx.c | 7 +++++++ gfx/drivers_context/ps3_ctx.c | 1 + gfx/drivers_context/sdl_gl_ctx.c | 7 +++++++ gfx/drivers_context/vc_egl_ctx.c | 8 ++++++++ gfx/drivers_context/vivante_fbdev_ctx.c | 8 ++++++++ gfx/drivers_context/wayland_ctx.c | 10 ++++++++++ gfx/drivers_context/wgl_ctx.c | 7 +++++++ gfx/drivers_context/xegl_ctx.c | 7 +++++++ gfx/video_context_driver.h | 2 ++ gfx/video_driver.c | 8 ++++++-- gfx/video_driver.h | 5 ++++- gfx/video_thread_wrapper.c | 3 ++- libretro.h | 13 +++++++++++++ 26 files changed, 160 insertions(+), 7 deletions(-) diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 859690204e..55f386b26a 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -324,6 +324,12 @@ CFStringRef)BOXSTRING(symbol_name) ); } +static void apple_gfx_ctx_make_current_context(void *data) +{ + (void)data; + [g_hw_ctx makeCurrentContext]; +} + static void apple_gfx_ctx_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height, unsigned frame_count) { @@ -384,6 +390,7 @@ const gfx_ctx_driver_t gfx_ctx_apple = { apple_gfx_ctx_swap_buffers, apple_gfx_ctx_input_driver, apple_gfx_ctx_get_proc_address, + apple_gfx_ctx_make_current_context, NULL, "apple", apple_gfx_ctx_bind_hw_render, diff --git a/dynamic.c b/dynamic.c index 2cf6167609..711c613d5d 100644 --- a/dynamic.c +++ b/dynamic.c @@ -1237,6 +1237,18 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; + case RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT: + case RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT | RETRO_ENVIRONMENT_EXPERIMENTAL: + { + struct retro_hw_make_current_context_callback *cb = + (struct retro_hw_make_current_context_callback*)data; + + RARCH_LOG("Environ MAKE_CURRENT_CONTEXT.\n"); + + cb->make_current_context = video_driver_make_current_context; + break; + } + default: RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); return false; diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index fa7644b8a4..3eab922646 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -1607,8 +1607,9 @@ static const video_poke_interface_t exynos_poke_interface = { NULL, /* set_filtering */ #ifdef HAVE_FBO NULL, /* get_current_framebuffer */ - NULL, /* get_proc_address */ #endif + NULL, /* get_proc_address */ + NULL, /* make_current_context */ exynos_set_aspect_ratio, exynos_apply_state_changes, #ifdef HAVE_MENU diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 36ba934bf5..e8757a85af 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -3100,13 +3100,21 @@ static struct video_shader *gl_get_current_shader(void *data) return (gl && gl->shader) ? gl->shader->get_current_shader() : NULL; } +static void gl_make_current_context(void *data) +{ + gl_t *gl = (gl_t*)data; + + if (gl && gl->ctx_driver->make_current_context) + gl->ctx_driver->make_current_context(gl); +} static const video_poke_interface_t gl_poke_interface = { NULL, #ifdef HAVE_FBO gl_get_current_framebuffer, - gl_get_proc_address, #endif + gl_get_proc_address, + gl_make_current_context, gl_set_aspect_ratio, gl_apply_state_changes, #if defined(HAVE_MENU) diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index aaadf41cf4..9bb1b66bda 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -1139,6 +1139,8 @@ static bool gx_read_viewport(void *data, uint8_t *buffer) } static const video_poke_interface_t gx_poke_interface = { + NULL, + NULL, NULL, gx_set_aspect_ratio, gx_apply_state_changes, diff --git a/gfx/drivers/psp1_gfx.c b/gfx/drivers/psp1_gfx.c index e067e9a948..66d70eb1f4 100644 --- a/gfx/drivers/psp1_gfx.c +++ b/gfx/drivers/psp1_gfx.c @@ -838,6 +838,8 @@ static void psp_viewport_info(void *data, struct rarch_viewport *vp) static const video_poke_interface_t psp_poke_interface = { psp_set_filtering, + NULL, + NULL, psp_set_aspect_ratio, psp_apply_state_changes, #ifdef HAVE_MENU diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index d1117bc68d..bb2d83b1fc 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -717,8 +717,9 @@ static video_poke_interface_t sdl2_video_poke_interface = { sdl2_poke_set_filtering, #ifdef HAVE_FBO NULL, - NULL, #endif + NULL, + NULL, sdl2_poke_set_aspect_ratio, sdl2_poke_apply_state_changes, #ifdef HAVE_MENU diff --git a/gfx/drivers_context/androidegl_ctx.c b/gfx/drivers_context/androidegl_ctx.c index dc923bc879..ebe4cde8d8 100644 --- a/gfx/drivers_context/androidegl_ctx.c +++ b/gfx/drivers_context/androidegl_ctx.c @@ -316,6 +316,16 @@ static gfx_ctx_proc_t android_gfx_ctx_get_proc_address( return ret; } +static void android_gfx_ctx_make_current_context(void *data) +{ + gfx_ctx_android_data_t *android = (gfx_ctx_android_data_t*) + driver.video_context_data; + + if (android) + eglMakeCurrent(android->g_egl_dpy, android->g_egl_surf, + android->g_egl_surf, android->g_egl_hw_ctx); +} + static bool android_gfx_ctx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -390,6 +400,7 @@ const gfx_ctx_driver_t gfx_ctx_android = { android_gfx_ctx_swap_buffers, android_gfx_ctx_input_driver, android_gfx_ctx_get_proc_address, + android_gfx_ctx_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/bbqnx_ctx.c b/gfx/drivers_context/bbqnx_ctx.c index 56d8e1ac8f..dd7d717912 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -398,6 +398,14 @@ static gfx_ctx_proc_t gfx_ctx_qnx_get_proc_address(const char *symbol) return ret; } +static void gfx_ctx_qnx_make_current_context(void *data) +{ + (void)data; + + eglMakeCurrent(g_egl_dpy, g_egl_surf, + g_egl_surf, g_egl_hw_ctx); +} + static bool gfx_ctx_qnx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -461,6 +469,7 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = { gfx_ctx_qnx_swap_buffers, gfx_ctx_qnx_input_driver, gfx_ctx_qnx_get_proc_address, + gfx_ctx_qnx_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 259615436b..aac2d0007b 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -509,6 +509,7 @@ const gfx_ctx_driver_t gfx_ctx_d3d = { gfx_ctx_d3d_swap_buffers, gfx_ctx_d3d_input_driver, NULL, + NULL, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index a79a81953e..5dac261c86 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -898,6 +898,15 @@ static gfx_ctx_proc_t gfx_ctx_drm_egl_get_proc_address(const char *symbol) return eglGetProcAddress(symbol); } +static void gfx_ctx_drm_egl_make_current_context(void *data) +{ + gfx_ctx_drm_egl_data_t *drm = (gfx_ctx_drm_egl_data_t*)data; + + if (drm) + eglMakeCurrent(drm->g_egl_dpy, drm->g_egl_surf, + drm->g_egl_surf, drm->g_egl_hw_ctx); +} + static bool gfx_ctx_drm_egl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -967,6 +976,7 @@ const gfx_ctx_driver_t gfx_ctx_drm_egl = { gfx_ctx_drm_egl_swap_buffers, gfx_ctx_drm_egl_input_driver, gfx_ctx_drm_egl_get_proc_address, + gfx_ctx_drm_egl_make_current_context, NULL, NULL, NULL, diff --git a/gfx/drivers_context/gfx_null_ctx.c b/gfx/drivers_context/gfx_null_ctx.c index 285f214cc4..aea53040bc 100644 --- a/gfx/drivers_context/gfx_null_ctx.c +++ b/gfx/drivers_context/gfx_null_ctx.c @@ -150,6 +150,7 @@ const gfx_ctx_driver_t gfx_ctx_null = { gfx_ctx_null_swap_buffers, gfx_ctx_null_input_driver, NULL, + NULL, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/glx_ctx.c b/gfx/drivers_context/glx_ctx.c index 5317d167b1..27633695b1 100644 --- a/gfx/drivers_context/glx_ctx.c +++ b/gfx/drivers_context/glx_ctx.c @@ -686,6 +686,15 @@ static gfx_ctx_proc_t gfx_ctx_glx_get_proc_address(const char *symbol) return glXGetProcAddress((const GLubyte*)symbol); } +static void gfx_ctx_glx_make_current_context(void *data) +{ + gfx_ctx_glx_data_t *glx = (gfx_ctx_glx_data_t*)data; + + if (glx) + glXMakeContextCurrent(glx->g_dpy, glx->g_glx_win, + glx->g_glx_win, glx->g_hw_ctx); +} + static bool gfx_ctx_glx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -743,6 +752,7 @@ const gfx_ctx_driver_t gfx_ctx_glx = { gfx_ctx_glx_swap_buffers, gfx_ctx_glx_input_driver, gfx_ctx_glx_get_proc_address, + gfx_ctx_glx_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 8baed37863..b1cfa45ec2 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -285,6 +285,12 @@ static gfx_ctx_proc_t gfx_ctx_mali_fbdev_get_proc_address(const char *symbol) return ret; } +static void gfx_ctx_mali_fbdev_make_current_context(void *data) +{ + /* FIXME : Hookup bind_hw_render */ + eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx); +} + static bool gfx_ctx_mali_fbdev_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -328,6 +334,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = { gfx_ctx_mali_fbdev_swap_buffers, gfx_ctx_mali_fbdev_input_driver, gfx_ctx_mali_fbdev_get_proc_address, + gfx_ctx_mali_fbdev_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index 9dc92850d3..dc9c8e988e 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -390,6 +390,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { gfx_ctx_ps3_input_driver, NULL, NULL, + NULL, "ps3", }; diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 9691495ad3..6fcc90e988 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -407,6 +407,12 @@ static gfx_ctx_proc_t sdl_ctx_get_proc_address(const char *name) return (gfx_ctx_proc_t)SDL_GL_GetProcAddress(name); } +static void sdl_ctx_make_current_context(void *data) +{ + /* TODO/FIXME: implement */ + (void)data; +} + static void sdl_ctx_show_mouse(void *data, bool state) { (void)data; @@ -431,6 +437,7 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl = sdl_ctx_swap_buffers, sdl_ctx_input_driver, sdl_ctx_get_proc_address, + sdl_ctx_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 6f6aa23e2a..2c1d4f2f51 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -442,6 +442,13 @@ static gfx_ctx_proc_t gfx_ctx_vc_get_proc_address(const char *symbol) return eglGetProcAddress(symbol); } +static gfx_ctx_proc_t gfx_ctx_vc_make_current_context(void *data) +{ + (void)data; + + eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_hw_ctx); +} + static float gfx_ctx_vc_translate_aspect(void *data, unsigned width, unsigned height) { @@ -606,6 +613,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = { gfx_ctx_vc_swap_buffers, gfx_ctx_vc_input_driver, gfx_ctx_vc_get_proc_address, + gfx_ctx_vc_make_current_context, gfx_ctx_vc_init_egl_image_buffer, gfx_ctx_vc_write_egl_image, NULL, diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index c20e1500c1..1a9f11dbd3 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -270,6 +270,13 @@ static gfx_ctx_proc_t gfx_ctx_vivante_get_proc_address(const char *symbol) return ret; } +static void gfx_ctx_vivante_make_current_context(void *data) +{ + /* TODO/FIXME: Implement bind_hw_render */ + (void)data; + eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx); +} + static bool gfx_ctx_vivante_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -313,6 +320,7 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = { gfx_ctx_vivante_swap_buffers, gfx_ctx_vivante_input_driver, gfx_ctx_vivante_get_proc_address, + gfx_ctx_vivante_make_current_context, #ifdef HAVE_EGL NULL, NULL, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index e43e1379d4..3a3267c7fd 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -682,6 +682,15 @@ static gfx_ctx_proc_t gfx_ctx_wl_get_proc_address(const char *symbol) return eglGetProcAddress(symbol); } +static void gfx_ctx_wl_make_current_context(void *data) +{ + gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data; + + if (wl) + eglMakeCurrent(wl->g_egl_dpy, wl->g_egl_surf, wl->g_egl_surf, + wl->g_egl_hw_ctx); +} + static bool gfx_ctx_wl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -890,6 +899,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = { gfx_ctx_wl_swap_buffers, gfx_ctx_wl_input_driver, gfx_ctx_wl_get_proc_address, + gfx_ctx_wl_make_current_context, NULL, NULL, NULL, diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index f6e6a574f2..4f4486db48 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -652,6 +652,12 @@ static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol) return (gfx_ctx_proc_t)GetProcAddress(dll_handle, symbol); } +static void gfx_ctx_wgl_make_current_context(void *data) +{ + (void)data; + wglMakeCurrent(g_hdc, g_hw_hrc); +} + static bool gfx_ctx_wgl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -694,6 +700,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = { gfx_ctx_wgl_swap_buffers, gfx_ctx_wgl_input_driver, gfx_ctx_wgl_get_proc_address, + gfx_ctx_wgl_make_current_context, gfx_ctx_wgl_show_mouse, "wgl", gfx_ctx_wgl_bind_hw_render, diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index a476fe58c6..751a1847a7 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -742,6 +742,12 @@ static gfx_ctx_proc_t gfx_ctx_xegl_get_proc_address(const char *symbol) return eglGetProcAddress(symbol); } +static void gfx_ctx_xegl_make_current_context(void *data) +{ + eglMakeCurrent(g_egl_dpy, g_egl_surf, + g_egl_surf, g_egl_hw_ctx); +} + static bool gfx_ctx_xegl_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -809,6 +815,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl = { gfx_ctx_xegl_swap_buffers, gfx_ctx_xegl_input_driver, gfx_ctx_xegl_get_proc_address, + gfx_ctx_xegl_make_current_context, NULL, NULL, gfx_ctx_xegl_show_mouse, diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index fb7aaaca42..21a20d40e2 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -110,6 +110,8 @@ typedef struct gfx_ctx_driver * Does not take opaque, to avoid lots of ugly wrapper code. */ gfx_ctx_proc_t (*get_proc_address)(const char*); + void (*make_current_context)(void *data); + #ifdef HAVE_EGL /* Returns true if this context supports EGLImage buffers for * screen drawing and was initalized correctly. */ diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 612232f18a..7e52513e76 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -222,13 +222,17 @@ uintptr_t video_driver_get_current_framebuffer(void) retro_proc_address_t video_driver_get_proc_address(const char *sym) { -#ifdef HAVE_FBO if (driver.video_poke && driver.video_poke->get_proc_address) return driver.video_poke->get_proc_address(driver.video_data, sym); -#endif return NULL; } +void video_driver_make_current_context(void) +{ + if (driver.video_poke && driver.video_poke->make_current_context) + driver.video_poke->make_current_context(driver.video_data); +} + static void deinit_video_filter(void) { rarch_softfilter_free(g_extern.filter.filter); diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 56ce0e104c..d4cd285588 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -89,8 +89,9 @@ typedef struct video_poke_interface void (*set_filtering)(void *data, unsigned index, bool smooth); #ifdef HAVE_FBO uintptr_t (*get_current_framebuffer)(void *data); - retro_proc_address_t (*get_proc_address)(void *data, const char *sym); #endif + retro_proc_address_t (*get_proc_address)(void *data, const char *sym); + void (*make_current_context)(void *data); void (*set_aspect_ratio)(void *data, unsigned aspectratio_index); void (*apply_state_changes)(void *data); @@ -241,6 +242,8 @@ uintptr_t video_driver_get_current_framebuffer(void); retro_proc_address_t video_driver_get_proc_address(const char *sym); +void video_driver_make_current_context(void); + void uninit_video_input(void); void init_video(void); diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 717427949d..6a49aefcf9 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -853,8 +853,9 @@ static const video_poke_interface_t thread_poke = { thread_set_filtering, #ifdef HAVE_FBO NULL, - NULL, #endif + NULL, + NULL, thread_set_aspect_ratio, thread_apply_state_changes, #if defined(HAVE_MENU) diff --git a/libretro.h b/libretro.h index 73882da714..194375ef94 100755 --- a/libretro.h +++ b/libretro.h @@ -852,6 +852,10 @@ enum retro_mod * It can be used by the core for localization purposes. */ +#define RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT 40 + /* struct retro_hw_make_current_context_callback * + */ + #define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */ #define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */ #define RETRO_MEMDESC_ALIGN_2 (1 << 16) /* All memory access in this area is aligned to their own size, or 2, whichever is smaller. */ @@ -1467,6 +1471,15 @@ enum retro_hw_context_type RETRO_HW_CONTEXT_DUMMY = INT_MAX }; +/* Call video context driver's 'make current context' function */ +typedef void (*retro_hw_make_current_context)(void); + +struct retro_hw_make_current_context_callback +{ + /* Set by frontend. */ + retro_hw_make_current_context make_current_context; +}; + struct retro_hw_render_callback { /* Which API to use. Set by libretro core. */