diff --git a/dynamic.c b/dynamic.c index e7c001ec4a..739c3500c1 100644 --- a/dynamic.c +++ b/dynamic.c @@ -39,6 +39,7 @@ #include "libretro_version_1.h" #include "performance.h" #include "system.h" +#include "gfx/video_context_driver.h" #include "cores/internal_cores.h" #include "frontend/frontend_driver.h" @@ -970,8 +971,15 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_HW_CONTEXT_OPENGL_CORE: - RARCH_LOG("Requesting core OpenGL context (%u.%u).\n", - cb->version_major, cb->version_minor); + { + gfx_ctx_flags_t flags; + BIT32_SET(flags.flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT); + + gfx_ctx_ctl(GFX_CTL_SET_FLAGS, &flags); + + RARCH_LOG("Requesting core OpenGL context (%u.%u).\n", + cb->version_major, cb->version_minor); + } break; #endif diff --git a/gfx/video_shader_driver.c b/gfx/video_shader_driver.c index 0c2091486e..d44f60a5bd 100644 --- a/gfx/video_shader_driver.c +++ b/gfx/video_shader_driver.c @@ -43,12 +43,9 @@ static const shader_backend_t *video_shader_set_backend(enum rarch_shader_type t #ifdef HAVE_CG gfx_ctx_flags_t flags; - struct retro_hw_render_callback *hwr = NULL; gfx_ctx_ctl(GFX_CTL_GET_FLAGS, &flags); - video_driver_ctl(RARCH_DISPLAY_CTL_HW_CONTEXT_GET, &hwr); -#if 0 - if ((flags.flags && (1UL << GFX_CTX_FLAGS_GL_CORE_CONTEXT)) && hwr && hwr->context_type != RETRO_HW_CONTEXT_NONE) + if (flags.flags && (1UL << GFX_CTX_FLAGS_GL_CORE_CONTEXT)) { RARCH_ERR("[Shader driver]: Cg cannot be used with core GL context. Trying to fall back to GLSL...\n"); #ifdef HAVE_GLSL @@ -56,7 +53,6 @@ static const shader_backend_t *video_shader_set_backend(enum rarch_shader_type t #endif } else -#endif { RARCH_LOG("[Shader driver]: Using Cg shader backend.\n"); return &gl_cg_backend;