From 6aa0680110064f38d147d9e8a3573652dbc9c3c3 Mon Sep 17 00:00:00 2001 From: dankcushions Date: Tue, 11 Aug 2020 13:47:51 +0100 Subject: [PATCH] GLES 3.1 and 3.2 build parameters, and corresponding context checks. --- qb/config.params.sh | 2 ++ retroarch.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/qb/config.params.sh b/qb/config.params.sh index 821e5b58b0..a0cb93d866 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -80,6 +80,8 @@ HAVE_VIVANTE_FBDEV=no # Vivante fbdev context support HAVE_OPENDINGUX_FBDEV=no # Opendingux fbdev context support HAVE_OPENGLES=no # Use GLESv2 instead of desktop GL HAVE_OPENGLES3=no # OpenGLES3 support +HAVE_OPENGLES3_1=no # OpenGLES3.1 support +HAVE_OPENGLES3_2=no # OpenGLES3.2 support HAVE_X11=auto # everything X11. HAVE_XRANDR=auto # Xrandr support. HAVE_OMAP=no # OMAP video support diff --git a/retroarch.c b/retroarch.c index 6a88c3108e..f08b0f1b4a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -18507,6 +18507,22 @@ static bool dynamic_request_hw_context(enum retro_hw_context_type type, #if defined(HAVE_OPENGLES3) case RETRO_HW_CONTEXT_OPENGLES_VERSION: +#ifndef HAVE_OPENGLES3_2 + if (major == 3 && minor == 2) + { + RARCH_ERR("Requesting OpenGLES%u.%u context, but RetroArch is compiled against a lesser version. Cannot use HW context.\n", + major, minor); + return false; + } +#endif +#if !defined(HAVE_OPENGLES3_2) && !defined(HAVE_OPENGLES3_1) + if (major == 3 && minor == 1) + { + RARCH_ERR("Requesting OpenGLES%u.%u context, but RetroArch is compiled against a lesser version. Cannot use HW context.\n", + major, minor); + return false; + } +#endif RARCH_LOG("Requesting OpenGLES%u.%u context.\n", major, minor); break;