From 200cf150449f4dbff987e7c48d7632f4780a0e82 Mon Sep 17 00:00:00 2001 From: Logan McNaughton Date: Mon, 31 Oct 2016 15:28:45 -0600 Subject: [PATCH] Add egl debug context option for Android According to https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_create_context.txt "The default value of EGL_CONTEXT_FLAGS_KHR is zero" So this should keep it at 0 if debug=false, and set it to EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR is debug=true Fixes https://github.com/libretro/RetroArch/issues/3910 --- gfx/drivers_context/android_ctx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index b77aa99f28..9abe1866e7 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -105,8 +105,11 @@ static void *android_gfx_ctx_init(void *video_driver) #ifdef HAVE_OPENGLES EGLint n, major, minor; EGLint format; + struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); + bool debug = hwr->debug_context; EGLint context_attributes[] = { EGL_CONTEXT_CLIENT_VERSION, g_es3 ? 3 : 2, + EGL_CONTEXT_FLAGS_KHR, debug ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0, EGL_NONE }; EGLint attribs[] = {