diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index f11d74ffe1..d62bd67cf4 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -2502,12 +2502,6 @@ static void video_texture_load_gl( ); } -static void video_texture_unload_gl( - uintptr_t *id) -{ - glDeleteTextures(1, (GLuint*)id); -} - #ifdef HAVE_THREADS static int video_texture_load_wrap_gl_mipmap(void *data) { @@ -2530,14 +2524,6 @@ static int video_texture_load_wrap_gl(void *data) TEXTURE_FILTER_LINEAR, &id); return (int)id; } - -static int video_texture_unload_wrap_gl(void *data) -{ - if (!data) - return 0; - video_texture_unload_gl((uintptr_t *)data); - return 0; -} #endif static uintptr_t gl_load_texture(void *video_data, void *data, @@ -2559,7 +2545,7 @@ static uintptr_t gl_load_texture(void *video_data, void *data, default: break; } - return video_thread_custom_cmd(data, func); + return video_thread_texture_load(data, func); } #endif @@ -2567,23 +2553,14 @@ static uintptr_t gl_load_texture(void *video_data, void *data, return id; } -static void gl_unload_texture(void *data, uintptr_t id, bool threaded) +static void gl_unload_texture(void *data, uintptr_t id) { GLuint glid; if (!id) return; + glid = (GLuint)id; - -#ifdef HAVE_THREADS - if (threaded) - { - custom_command_method_t func = video_texture_unload_wrap_gl; - video_thread_custom_cmd(&glid, func); - return; - } -#endif - - video_texture_unload_gl(&glid); + glDeleteTextures(1, &glid); } static void gl_set_coords(void *handle_data, void *shader_data, diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 1290b3792d..7f3b2a2c0e 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -1425,7 +1425,7 @@ bool video_thread_font_init(const void **font_driver, void **font_handle, return pkt.data.font_init.return_value; } -unsigned video_thread_custom_cmd(void *data, +unsigned video_thread_texture_load(void *data, custom_command_method_t func) { thread_video_t *thr = (thread_video_t*)video_driver_get_ptr(true); diff --git a/gfx/video_thread_wrapper.h b/gfx/video_thread_wrapper.h index 5aba4fd741..3fd306590a 100644 --- a/gfx/video_thread_wrapper.h +++ b/gfx/video_thread_wrapper.h @@ -83,7 +83,7 @@ bool video_thread_font_init( custom_font_command_method_t func, bool is_threaded); -unsigned video_thread_custom_cmd(void *data, +unsigned video_thread_texture_load(void *data, custom_command_method_t func); RETRO_END_DECLS