diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 518f962d2c..2937b6cf4e 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -592,7 +592,6 @@ static MPGLContext *init_backend(struct vo *vo, const struct backend *backend, .gl = talloc_zero(ctx, GL), .vo = vo, .driver = backend->driver, - .requested_gl_version = 300, }; bool old_probing = vo->probing; vo->probing = probing; // hack; kill it once backends are separate diff --git a/video/out/gl_common.h b/video/out/gl_common.h index 3b5def0346..f163e4fd28 100644 --- a/video/out/gl_common.h +++ b/video/out/gl_common.h @@ -86,16 +86,12 @@ struct mpgl_driver { int priv_size; // Init the GL context and possibly the underlying VO backend. + // The created context should be compatible to GL 3.2 core profile, but + // some other GL versions are supported as well (e.g. GL 2.1 or GLES 2). // Return 0 on success, negative value (-1) on error. int (*init)(struct MPGLContext *ctx, int vo_flags); // Resize the window, or create a new window if there isn't one yet. - // On the first call, it creates a GL context according to what's specified - // in MPGLContext.requested_gl_version. This is just a hint, and if the - // requested version is not available, it may return a completely different - // GL context. (The caller must check if the created GL version is ok. The - // callee must try to fall back to an older version if the requested - // version is not available, and newer versions are incompatible.) // Currently, there is an unfortunate interaction with ctx->vo, and // display size etc. are determined by it. // Return 0 on success, negative value (-1) on error. @@ -119,10 +115,6 @@ typedef struct MPGLContext { // Bit size of each component in the created framebuffer. 0 if unknown. int depth_r, depth_g, depth_b; - // GL version requested from config_window_gl3 backend (MPGL_VER mangled). - // (Might be different from the actual version in gl->version.) - int requested_gl_version; - // For free use by the mpgl_driver. void *priv; @@ -142,12 +134,7 @@ typedef struct MPGLContext { // Resize the window, or create a new window if there isn't one yet. - // On the first call, it creates a GL context according to what's specified - // in MPGLContext.requested_gl_version. This is just a hint, and if the - // requested version is not available, it may return a completely different - // GL context. (The caller must check if the created GL version is ok. The - // callee must try to fall back to an older version if the requested - // version is not available, and newer versions are incompatible.) + // On the first call, it creates a GL context. bool (*config_window)(struct MPGLContext *ctx, int flags); // Optional callback on the beginning of a frame. The frame will be finished diff --git a/video/out/gl_w32.c b/video/out/gl_w32.c index ccb7679109..87f98f117e 100644 --- a/video/out/gl_w32.c +++ b/video/out/gl_w32.c @@ -150,10 +150,9 @@ static bool create_context_w32_gl3(struct MPGLContext *ctx) if (!wglCreateContextAttribsARB) goto unsupported; - int gl_version = ctx->requested_gl_version; int attribs[] = { - WGL_CONTEXT_MAJOR_VERSION_ARB, MPGL_VER_GET_MAJOR(gl_version), - WGL_CONTEXT_MINOR_VERSION_ARB, MPGL_VER_GET_MINOR(gl_version), + WGL_CONTEXT_MAJOR_VERSION_ARB, 3, + WGL_CONTEXT_MINOR_VERSION_ARB, 0, WGL_CONTEXT_FLAGS_ARB, 0, WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, 0 diff --git a/video/out/gl_wayland.c b/video/out/gl_wayland.c index 3307087a44..ecfa5b3298 100644 --- a/video/out/gl_wayland.c +++ b/video/out/gl_wayland.c @@ -89,8 +89,7 @@ static bool egl_create_context(struct vo_wayland_state *wl, MP_VERBOSE(wl, "EGL version %d.%d\n", major, minor); EGLint context_attribs[] = { - EGL_CONTEXT_MAJOR_VERSION_KHR, - MPGL_VER_GET_MAJOR(ctx->requested_gl_version), + EGL_CONTEXT_MAJOR_VERSION_KHR, 3, EGL_NONE }; diff --git a/video/out/gl_x11.c b/video/out/gl_x11.c index 55099fb797..eeaa01f94c 100644 --- a/video/out/gl_x11.c +++ b/video/out/gl_x11.c @@ -242,10 +242,9 @@ static bool config_window_x11(struct MPGLContext *ctx, int flags) vo_x11_config_vo_window(vo, glx_ctx->vinfo, flags | VOFLAG_HIDDEN, "gl"); - int gl_version = ctx->requested_gl_version; bool success = false; if (!(flags & VOFLAG_GLES)) { - success = create_context_x11_gl3(ctx, flags, gl_version, false); + success = create_context_x11_gl3(ctx, flags, 300, false); if (!success) success = create_context_x11_old(ctx); } diff --git a/video/out/gl_x11egl.c b/video/out/gl_x11egl.c index bfb88c3110..9db0bee0a9 100644 --- a/video/out/gl_x11egl.c +++ b/video/out/gl_x11egl.c @@ -67,8 +67,8 @@ static bool create_context_egl(MPGLContext *ctx, EGLConfig config, struct priv *p = ctx->priv; EGLint context_attributes[] = { - EGL_CONTEXT_CLIENT_VERSION, // aka EGL_CONTEXT_MAJOR_VERSION_KHR - es ? 2 : MPGL_VER_GET_MAJOR(ctx->requested_gl_version), + // aka EGL_CONTEXT_MAJOR_VERSION_KHR + EGL_CONTEXT_CLIENT_VERSION, es ? 2 : 3, EGL_NONE };