summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-10-02 22:38:12 +0100
committerDudemanguy <random342@airmail.cc>2021-10-16 20:33:53 +0000
commite13fe1299d8aefdc264e74159cce07b8bfcf722c (patch)
treeac4baeae8b785f9fc462aea12a9003c7c76d15e1
parent6354540cf8c309e11ff4b6f33d2e97d57771399a (diff)
downloadmpv-e13fe1299d8aefdc264e74159cce07b8bfcf722c.tar.bz2
mpv-e13fe1299d8aefdc264e74159cce07b8bfcf722c.tar.xz
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 <emil.l.velikov@gmail.com>
-rw-r--r--video/out/opengl/egl_helpers.c4
1 files changed, 4 insertions, 0 deletions
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
};