From 950bf29c27c1ad04ff27ba2803797b478f7e4cf4 Mon Sep 17 00:00:00 2001 From: Autechre Date: Sun, 24 May 2020 23:42:12 +0200 Subject: [PATCH] Revert "Revert "(video) fix "Allow Cores to Switch the Video Driver OFF" behavior"" --- retroarch.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/retroarch.c b/retroarch.c index ffd4ba790b..45234ea146 100644 --- a/retroarch.c +++ b/retroarch.c @@ -9946,9 +9946,11 @@ static bool dynamic_verify_hw_context(enum retro_hw_context_type type, case RETRO_HW_CONTEXT_OPENGLES3: case RETRO_HW_CONTEXT_OPENGLES_VERSION: case RETRO_HW_CONTEXT_OPENGL: + if (!string_is_equal(video_ident, "gl")) + return false; + break; case RETRO_HW_CONTEXT_OPENGL_CORE: - if (!string_is_equal(video_ident, "gl") && - !string_is_equal(video_ident, "glcore")) + if (!string_is_equal(video_ident, "glcore")) return false; break; case RETRO_HW_CONTEXT_DIRECT3D: @@ -22340,42 +22342,27 @@ static bool video_driver_find_driver(void) } #endif -#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL_CORE) +#if defined(HAVE_OPENGL) if (hwr && hw_render_context_is_gl(hwr->context_type)) { RARCH_LOG("[Video]: Using HW render, OpenGL driver forced.\n"); - - /* If we have configured one of the HW render capable GL drivers, go with that. */ - if ( !string_is_equal(settings->arrays.video_driver, "gl") && - !string_is_equal(settings->arrays.video_driver, "glcore")) + if (!string_is_equal(settings->arrays.video_driver, "gl")) { RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver); strlcpy(cached_video_driver, settings->arrays.video_driver, sizeof(cached_video_driver)); -#if defined(HAVE_OPENGL_CORE) - RARCH_LOG("[Video]: Forcing \"glcore\" driver.\n"); configuration_set_string(settings, - settings->arrays.video_driver, "glcore"); - current_video = &video_gl_core; -#else - RARCH_LOG("[Video]: Forcing \"gl\" driver.\n"); - configuration_set_string(settings, - settings->arrays.video_driver, "gl"); - current_video = &video_gl2; -#endif - } - else - { - RARCH_LOG("[Video]: Using configured \"%s\" driver for GL HW render.\n", - settings->arrays.video_driver); + settings->arrays.video_driver, + "gl"); } + current_video = &video_gl2; } #endif #if defined(HAVE_OPENGL_CORE) if (hwr && hw_render_context_is_glcore(hwr->context_type)) { - RARCH_LOG("[Video]: Using HW render, OpenGL core driver forced.\n"); + RARCH_LOG("[Video]: Using HW render, core OpenGL driver forced.\n"); if (!string_is_equal(settings->arrays.video_driver, "glcore")) { RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver);