From 8f5809ee46d8810525c47703af98fdec5f6338d9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 16 Feb 2015 23:41:49 +0100 Subject: [PATCH] Take out make_current_context --- apple/common/apple_gfx_context.c.inl | 7 ------- dynamic.c | 11 ----------- gfx/drivers/exynos_gfx.c | 1 - gfx/drivers/gl.c | 9 --------- gfx/drivers/sdl2_gfx.c | 1 - gfx/drivers_context/androidegl_ctx.c | 11 ----------- gfx/drivers_context/bbqnx_ctx.c | 9 --------- 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 | 6 ------ gfx/video_driver.h | 3 --- gfx/video_thread_wrapper.c | 1 - libretro.h | 13 ------------- 23 files changed, 150 deletions(-) diff --git a/apple/common/apple_gfx_context.c.inl b/apple/common/apple_gfx_context.c.inl index 55f386b26a..859690204e 100644 --- a/apple/common/apple_gfx_context.c.inl +++ b/apple/common/apple_gfx_context.c.inl @@ -324,12 +324,6 @@ 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) { @@ -390,7 +384,6 @@ 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 355f69e7af..2cf6167609 100644 --- a/dynamic.c +++ b/dynamic.c @@ -1237,17 +1237,6 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; - case RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT: - { - 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 59d832f453..bfdef1c94e 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -1609,7 +1609,6 @@ static const video_poke_interface_t exynos_poke_interface = { NULL, /* get_current_framebuffer */ #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 79ba27fa3b..753d6a59ca 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -3088,21 +3088,12 @@ 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, #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/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index 85c89a8110..878fad3d2f 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -721,7 +721,6 @@ static video_poke_interface_t sdl2_video_poke_interface = { #ifdef HAVE_FBO NULL, #endif - NULL, NULL, sdl2_poke_set_aspect_ratio, sdl2_poke_apply_state_changes, diff --git a/gfx/drivers_context/androidegl_ctx.c b/gfx/drivers_context/androidegl_ctx.c index ebe4cde8d8..dc923bc879 100644 --- a/gfx/drivers_context/androidegl_ctx.c +++ b/gfx/drivers_context/androidegl_ctx.c @@ -316,16 +316,6 @@ 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) { @@ -400,7 +390,6 @@ 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 dd7d717912..56d8e1ac8f 100644 --- a/gfx/drivers_context/bbqnx_ctx.c +++ b/gfx/drivers_context/bbqnx_ctx.c @@ -398,14 +398,6 @@ 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) { @@ -469,7 +461,6 @@ 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/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index 5dac261c86..a79a81953e 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -898,15 +898,6 @@ 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) { @@ -976,7 +967,6 @@ 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 aea53040bc..285f214cc4 100644 --- a/gfx/drivers_context/gfx_null_ctx.c +++ b/gfx/drivers_context/gfx_null_ctx.c @@ -150,7 +150,6 @@ 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 f4609f4270..5317d167b1 100644 --- a/gfx/drivers_context/glx_ctx.c +++ b/gfx/drivers_context/glx_ctx.c @@ -686,15 +686,6 @@ 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*)driver.video_context_data; - - if (glx) - glXMakeContextCurrent(glx->g_dpy, glx->g_glx_win, - glx->g_glx_win, glx->g_use_hw_ctx ? glx->g_hw_ctx : glx->g_ctx); -} - static bool gfx_ctx_glx_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { @@ -752,7 +743,6 @@ 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 b1cfa45ec2..8baed37863 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -285,12 +285,6 @@ 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) { @@ -334,7 +328,6 @@ 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 dc9c8e988e..9dc92850d3 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -390,7 +390,6 @@ 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 6fcc90e988..9691495ad3 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -407,12 +407,6 @@ 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; @@ -437,7 +431,6 @@ 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 2c1d4f2f51..6f6aa23e2a 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -442,13 +442,6 @@ 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) { @@ -613,7 +606,6 @@ 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 1a9f11dbd3..c20e1500c1 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -270,13 +270,6 @@ 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) { @@ -320,7 +313,6 @@ 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 3a3267c7fd..e43e1379d4 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -682,15 +682,6 @@ 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) { @@ -899,7 +890,6 @@ 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 4f4486db48..f6e6a574f2 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -652,12 +652,6 @@ 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) { @@ -700,7 +694,6 @@ 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 751a1847a7..a476fe58c6 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -742,12 +742,6 @@ 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) { @@ -815,7 +809,6 @@ 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 21a20d40e2..fb7aaaca42 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -110,8 +110,6 @@ 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 e3d3856756..0a01ed128c 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -226,12 +226,6 @@ retro_proc_address_t video_driver_get_proc_address(const char *sym) 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); -} - bool video_driver_is_alive(void) { /* Possible race issue, return true */ diff --git a/gfx/video_driver.h b/gfx/video_driver.h index fffcfb09be..7a2a94f060 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -97,7 +97,6 @@ typedef struct video_poke_interface uintptr_t (*get_current_framebuffer)(void *data); #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); @@ -248,8 +247,6 @@ 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); - bool video_driver_is_alive(void); bool video_driver_has_focus(void); diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 17fb2486f2..94dd197f51 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -855,7 +855,6 @@ static const video_poke_interface_t thread_poke = { #ifdef HAVE_FBO NULL, #endif - NULL, NULL, thread_set_aspect_ratio, thread_apply_state_changes, diff --git a/libretro.h b/libretro.h index a7e46fe1ac..73882da714 100755 --- a/libretro.h +++ b/libretro.h @@ -852,10 +852,6 @@ enum retro_mod * It can be used by the core for localization purposes. */ -#define RETRO_ENVIRONMENT_MAKE_CURRENT_CONTEXT (40 | RETRO_ENVIRONMENT_EXPERIMENTAL) - /* 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. */ @@ -1471,15 +1467,6 @@ 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. */