mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +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";
|
||||
#endif
|
||||
|
||||
gl->shared_context_use = g_settings.video.shared_context && cb->context_type != RETRO_HW_CONTEXT_NONE;
|
||||
|
||||
if (*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.
|
||||
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))
|
||||
{
|
||||
@ -1946,7 +1948,7 @@ static const gfx_ctx_driver_t *gl_get_context(gl_t *gl)
|
||||
return ctx;
|
||||
}
|
||||
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
|
||||
|
@ -45,7 +45,7 @@
|
||||
#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_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) \
|
||||
gl->ctx_driver->check_window(gl, quit, resize, width, height, frame_count)
|
||||
|
||||
@ -179,6 +179,7 @@ typedef struct gl
|
||||
bool has_fp_fbo;
|
||||
#endif
|
||||
bool hw_render_use;
|
||||
bool shared_context_use;
|
||||
|
||||
bool should_resize;
|
||||
bool quitting;
|
||||
|
Loading…
x
Reference in New Issue
Block a user