Revert "Revert "(video) fix "Allow Cores to Switch the Video Driver OFF" behavior""

This commit is contained in:
Autechre 2020-05-24 23:42:12 +02:00 committed by GitHub
parent 2e26a05875
commit 950bf29c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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_OPENGLES3:
case RETRO_HW_CONTEXT_OPENGLES_VERSION: case RETRO_HW_CONTEXT_OPENGLES_VERSION:
case RETRO_HW_CONTEXT_OPENGL: case RETRO_HW_CONTEXT_OPENGL:
if (!string_is_equal(video_ident, "gl"))
return false;
break;
case RETRO_HW_CONTEXT_OPENGL_CORE: case RETRO_HW_CONTEXT_OPENGL_CORE:
if (!string_is_equal(video_ident, "gl") && if (!string_is_equal(video_ident, "glcore"))
!string_is_equal(video_ident, "glcore"))
return false; return false;
break; break;
case RETRO_HW_CONTEXT_DIRECT3D: case RETRO_HW_CONTEXT_DIRECT3D:
@ -22340,42 +22342,27 @@ static bool video_driver_find_driver(void)
} }
#endif #endif
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGL_CORE) #if defined(HAVE_OPENGL)
if (hwr && hw_render_context_is_gl(hwr->context_type)) if (hwr && hw_render_context_is_gl(hwr->context_type))
{ {
RARCH_LOG("[Video]: Using HW render, OpenGL driver forced.\n"); RARCH_LOG("[Video]: Using HW render, OpenGL driver forced.\n");
if (!string_is_equal(settings->arrays.video_driver, "gl"))
/* 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"))
{ {
RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver); RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver);
strlcpy(cached_video_driver, settings->arrays.video_driver, strlcpy(cached_video_driver, settings->arrays.video_driver,
sizeof(cached_video_driver)); sizeof(cached_video_driver));
#if defined(HAVE_OPENGL_CORE)
RARCH_LOG("[Video]: Forcing \"glcore\" driver.\n");
configuration_set_string(settings, configuration_set_string(settings,
settings->arrays.video_driver, "glcore"); settings->arrays.video_driver,
current_video = &video_gl_core; "gl");
#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);
} }
current_video = &video_gl2;
} }
#endif #endif
#if defined(HAVE_OPENGL_CORE) #if defined(HAVE_OPENGL_CORE)
if (hwr && hw_render_context_is_glcore(hwr->context_type)) 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")) if (!string_is_equal(settings->arrays.video_driver, "glcore"))
{ {
RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver); RARCH_LOG("[Video]: \"%s\" saved as cached driver.\n", settings->arrays.video_driver);