From e13fe1299d8aefdc264e74159cce07b8bfcf722c Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 2 Oct 2021 22:38:12 +0100 Subject: egl_helpers: add support for debug contexts With the recent refactor and quick look against the GLX code path, it's fairly obvious, and trivial, how to add support for debug contexts. Signed-off-by: Emil Velikov --- video/out/opengl/egl_helpers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/out/opengl/egl_helpers.c b/video/out/opengl/egl_helpers.c index ac40ac4146..fc28c61e62 100644 --- a/video/out/opengl/egl_helpers.c +++ b/video/out/opengl/egl_helpers.c @@ -161,6 +161,7 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display, MP_DBG(ctx, "Chosen EGLConfig:\n"); dump_egl_config(ctx->log, MSGL_DEBUG, display, config); + int ctx_flags = ctx->opts.debug ? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0; EGLContext *egl_ctx = NULL; if (!es) { @@ -172,6 +173,7 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display, EGL_CONTEXT_MINOR_VERSION, MPGL_VER_GET_MINOR(ver), EGL_CONTEXT_OPENGL_PROFILE_MASK, ver >= 320 ? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT : 0, + EGL_CONTEXT_FLAGS_KHR, ctx_flags, EGL_NONE }; @@ -182,8 +184,10 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display, } if (!egl_ctx) { // Fallback for EGL 1.4 without EGL_KHR_create_context or GLES + // Add the context flags only for GLES - GL has been attempted above EGLint attrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, + es ? EGL_CONTEXT_FLAGS_KHR : EGL_NONE, ctx_flags, EGL_NONE }; -- cgit v1.2.3