mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 19:21:06 +00:00
Only bind shared context if necessary.
This commit is contained in:
parent
1cbb47229a
commit
095718c855
6
gfx/gl.c
6
gfx/gl.c
@ -1916,6 +1916,8 @@ static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
|||||||
const char *api_name = "OpenGL";
|
const char *api_name = "OpenGL";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gl->shared_context_use = g_settings.video.shared_context && cb->context_type != RETRO_HW_CONTEXT_NONE;
|
||||||
|
|
||||||
if (*g_settings.video.gl_context)
|
if (*g_settings.video.gl_context)
|
||||||
{
|
{
|
||||||
const gfx_ctx_driver_t *ctx = gfx_ctx_find_driver(g_settings.video.gl_context);
|
const gfx_ctx_driver_t *ctx = gfx_ctx_find_driver(g_settings.video.gl_context);
|
||||||
@ -1929,7 +1931,7 @@ static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
|||||||
|
|
||||||
// Enables or disables offscreen HW context.
|
// Enables or disables offscreen HW context.
|
||||||
if (ctx->bind_hw_render)
|
if (ctx->bind_hw_render)
|
||||||
ctx->bind_hw_render(gl, g_settings.video.shared_context && cb->context_type != RETRO_HW_CONTEXT_NONE);
|
ctx->bind_hw_render(gl, gl->shared_context_use);
|
||||||
|
|
||||||
if (!ctx->init(gl))
|
if (!ctx->init(gl))
|
||||||
{
|
{
|
||||||
@ -1946,7 +1948,7 @@ static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
|||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return gfx_ctx_init_first(gl, api, major, minor, cb->context_type != RETRO_HW_CONTEXT_NONE);
|
return gfx_ctx_init_first(gl, api, major, minor, gl->shared_context_use);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GL_DEBUG
|
#ifdef GL_DEBUG
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
#define context_swap_buffers_func(gl) gl->ctx_driver->swap_buffers(gl)
|
#define context_swap_buffers_func(gl) gl->ctx_driver->swap_buffers(gl)
|
||||||
#define context_swap_interval_func(gl, var) gl->ctx_driver->swap_interval(gl, var)
|
#define context_swap_interval_func(gl, var) gl->ctx_driver->swap_interval(gl, var)
|
||||||
#define context_has_focus_func(gl) gl->ctx_driver->has_focus(gl)
|
#define context_has_focus_func(gl) gl->ctx_driver->has_focus(gl)
|
||||||
#define context_bind_hw_render(gl, enable) if (gl->hw_render_use && gl->ctx_driver->bind_hw_render) gl->ctx_driver->bind_hw_render(gl, enable)
|
#define context_bind_hw_render(gl, enable) if (gl->shared_context_use && gl->ctx_driver->bind_hw_render) gl->ctx_driver->bind_hw_render(gl, enable)
|
||||||
#define context_check_window_func(gl, quit, resize, width, height, frame_count) \
|
#define context_check_window_func(gl, quit, resize, width, height, frame_count) \
|
||||||
gl->ctx_driver->check_window(gl, quit, resize, width, height, frame_count)
|
gl->ctx_driver->check_window(gl, quit, resize, width, height, frame_count)
|
||||||
|
|
||||||
@ -179,6 +179,7 @@ typedef struct gl
|
|||||||
bool has_fp_fbo;
|
bool has_fp_fbo;
|
||||||
#endif
|
#endif
|
||||||
bool hw_render_use;
|
bool hw_render_use;
|
||||||
|
bool shared_context_use;
|
||||||
|
|
||||||
bool should_resize;
|
bool should_resize;
|
||||||
bool quitting;
|
bool quitting;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user