summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/context.c1
-rw-r--r--video/out/opengl/context.h2
-rw-r--r--video/out/opengl/context_angle.c22
3 files changed, 23 insertions, 2 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index fb3471cd3b..478421385c 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -159,6 +159,7 @@ static MPGLContext *init_backend(struct vo *vo, const struct mpgl_driver *driver
*ctx = (MPGLContext) {
.gl = talloc_zero(ctx, GL),
.vo = vo,
+ .global = vo->global,
.driver = driver,
};
if (probing)
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index d0588ddbd9..119bba0ba6 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -32,7 +32,6 @@ enum {
VOFLAG_GL_DEBUG = 1 << 2, // Hint to request debug OpenGL context
VOFLAG_ALPHA = 1 << 3, // Hint to request alpha framebuffer
VOFLAG_SW = 1 << 4, // Hint to accept a software GL renderer
- VOFLAG_ANGLE_DCOMP = 1 << 5, // Whether DirectComposition is allowed
VOFLAG_PROBING = 1 << 6, // The backend is being auto-probed.
};
@@ -78,6 +77,7 @@ typedef struct MPGLContext {
GL *gl;
struct vo *vo;
const struct mpgl_driver *driver;
+ struct mpv_global *global;
// For hwdec_vaegl.c.
const char *native_display_type;
diff --git a/video/out/opengl/context_angle.c b/video/out/opengl/context_angle.c
index 44aed340e3..5af18e9928 100644
--- a/video/out/opengl/context_angle.c
+++ b/video/out/opengl/context_angle.c
@@ -24,6 +24,7 @@
#include "angle_dynamic.h"
#include "common/common.h"
+#include "options/m_config.h"
#include "video/out/w32_common.h"
#include "context.h"
@@ -36,6 +37,22 @@
// Windows 8 enum value, not present in mingw-w64 headers
#define DXGI_ADAPTER_FLAG_SOFTWARE (2)
+struct angle_opts {
+ int allow_direct_composition;
+};
+
+#define OPT_BASE_STRUCT struct angle_opts
+const struct m_sub_options angle_conf = {
+ .opts = (const struct m_option[]) {
+ OPT_FLAG("opengl-dcomposition", allow_direct_composition, 0),
+ {0}
+ },
+ .defaults = &(const struct angle_opts) {
+ .allow_direct_composition = 1,
+ },
+ .size = sizeof(struct angle_opts),
+};
+
struct priv {
EGLDisplay egl_display;
EGLContext egl_context;
@@ -43,6 +60,7 @@ struct priv {
bool use_es2;
bool sw_adapter_msg_shown;
PFNEGLPOSTSUBBUFFERNVPROC eglPostSubBufferNV;
+ struct angle_opts *opts;
};
static void angle_uninit(MPGLContext *ctx)
@@ -217,6 +235,8 @@ static int angle_init(struct MPGLContext *ctx, int flags)
struct priv *p = ctx->priv;
struct vo *vo = ctx->vo;
+ p->opts = mp_get_config_group(ctx, ctx->global, &angle_conf);
+
if (!angle_load()) {
MP_VERBOSE(vo, "Failed to load LIBEGL.DLL\n");
goto fail;
@@ -309,7 +329,7 @@ static int angle_init(struct MPGLContext *ctx, int flags)
// behavior with some drivers (Intel? symptom - whole desktop is black for
// some seconds after spending some minutes in fullscreen and then leaving
// fullscreen).
- if ((flags & VOFLAG_ANGLE_DCOMP) &&
+ if (p->opts->allow_direct_composition &&
strstr(exts, "EGL_ANGLE_direct_composition"))
{
MP_TARRAY_APPEND(NULL, window_attribs, window_attribs_len,