From d5df90a295904e05a7bc26db31e8334b6c5c0e6e Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Nov 2015 17:33:32 +0100 Subject: vo_opengl: use ANGLE by default if available (except for "hq" preset) Running mpv with default config will now pick up ANGLE by default. Since some think ANGLE is still not good enough for hq features, extend the "es" option to reject GLES backends, and add to to the opengl-hq preset. One consequence is that mpv will by default use libswscale to convert 10 bit video to 8 bit, before it reaches the VO. --- DOCS/man/vo.rst | 17 ++++++++++++++--- video/out/opengl/common.c | 10 +++++----- video/out/opengl/common.h | 9 +++++---- video/out/vo_opengl.c | 7 +++++-- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index 5376f269e3..031232030e 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -777,6 +777,10 @@ Available video output drivers are: Cocoa/OS X win Win32/WGL + angle + Direct3D11 through the OpenGL ES translation layer ANGLE. This + supports almost everything the ``win`` backend does, except ICC + profiles, high bit depth video input, and the ``nnedi3`` prescaler. x11 X11/GLX wayland @@ -786,8 +790,15 @@ Available video output drivers are: x11egl X11/EGL - ``es`` - Force or prefer GLES2/3 over desktop OpenGL, if supported. + ``es=`` + Select whether to use GLES: + + yes + Try to prefer ES over Desktop GL + no + Try to prefer desktop GL over ES + auto + Use the default for each backend (default) ``fbo-format=`` Selects the internal format of textures used for FBOs. The format can @@ -955,7 +966,7 @@ Available video output drivers are: This is equivalent to:: - --vo=opengl:scale=spline36:cscale=spline36:dscale=mitchell:dither-depth=auto:correct-downscaling:sigmoid-upscaling:pbo:deband + --vo=opengl:scale=spline36:cscale=spline36:dscale=mitchell:dither-depth=auto:correct-downscaling:sigmoid-upscaling:pbo:deband:es=no Note that some cheaper LCDs do dithering that gravely interferes with ``opengl``'s dithering. Disabling dithering with ``dither-depth=no`` helps. diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index 21e749b9f3..ae4384ec30 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -535,12 +535,12 @@ static const struct mpgl_driver *const backends[] = { #if HAVE_GL_COCOA &mpgl_driver_cocoa, #endif -#if HAVE_GL_WIN32 - &mpgl_driver_w32, -#endif #if HAVE_EGL_ANGLE &mpgl_driver_angle, #endif +#if HAVE_GL_WIN32 + &mpgl_driver_w32, +#endif #if HAVE_GL_WAYLAND &mpgl_driver_wayland, #endif @@ -630,8 +630,8 @@ static MPGLContext *init_backend(struct vo *vo, const struct mpgl_driver *driver if (!ctx->gl->version && !ctx->gl->es) goto cleanup; - if (ctx->gl->es && vo->probing) { - MP_INFO(ctx->vo, "Skipping experimental GLES support (use --vo=opengl).\n"); + if (probing && ctx->gl->es && (vo_flags & VOFLAG_NO_GLES)) { + MP_VERBOSE(ctx->vo, "Skipping GLES backend.\n"); goto cleanup; } diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h index acae464643..8d5bbdbb6d 100644 --- a/video/out/opengl/common.h +++ b/video/out/opengl/common.h @@ -75,10 +75,11 @@ enum { #define MPGL_VER_P(ver) MPGL_VER_GET_MAJOR(ver), MPGL_VER_GET_MINOR(ver) enum { - VOFLAG_GLES = 1 << 0, // Hint to prefer GLES2 if possible - VOFLAG_GL_DEBUG = 1 << 1, // Hint to request debug OpenGL context - VOFLAG_ALPHA = 1 << 2, // Hint to request alpha framebuffer - VOFLAG_SW = 1 << 3, // Hint to accept a software GL renderer + VOFLAG_GLES = 1 << 0, // Hint to create a GLES2 context + VOFLAG_NO_GLES = 1 << 1, // Hint to create a desktop GL context + 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 }; struct MPGLContext; diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 1147aba79a..eb057d139f 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -397,8 +397,10 @@ static int preinit(struct vo *vo) if (p->use_gl_debug) vo_flags |= VOFLAG_GL_DEBUG; - if (p->es) + if (p->es == 1) vo_flags |= VOFLAG_GLES; + if (p->es == -1) + vo_flags |= VOFLAG_NO_GLES; if (p->allow_sw) vo_flags |= VOFLAG_SW; @@ -462,7 +464,7 @@ static const struct m_option options[] = { OPT_FLAG("debug", use_gl_debug, 0), OPT_STRING_VALIDATE("backend", backend, 0, mpgl_validate_backend_opt), OPT_FLAG("sw", allow_sw, 0), - OPT_FLAG("es", es, 0), + OPT_CHOICE("es", es, 0, ({"no", -1}, {"auto", 0}, {"yes", 1})), OPT_INTPAIR("check-pattern", opt_pattern, 0), OPT_INTRANGE("vsync-fences", opt_vsync_fences, 0, 0, NUM_VSYNC_FENCES), @@ -502,6 +504,7 @@ const struct vo_driver video_out_opengl_hq = { .priv_size = sizeof(struct gl_priv), .priv_defaults = &(const struct gl_priv){ .renderer_opts = (struct gl_video_opts *)&gl_video_opts_hq_def, + .es = -1, }, .options = options, }; -- cgit v1.2.3