summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-19 21:20:50 +0100
committerwm4 <wm4@nowhere>2015-11-19 21:20:50 +0100
commit6df3fa2ec1ee0e8a36bdad4e45107c01681db730 (patch)
treecaa610f106b145684483fc4ecbef46fb1e49baf0
parent1a8b06f67e8063f687bfc251440235c86b7bdcb7 (diff)
downloadmpv-6df3fa2ec1ee0e8a36bdad4e45107c01681db730.tar.bz2
mpv-6df3fa2ec1ee0e8a36bdad4e45107c01681db730.tar.xz
vo_opengl: switch FBO format on GLES
GL_RGB10_A2 is the best fixed-point format we can get on GLES/ANGLE for now. (Unless we somehow switch to non-normalized integer textures.)
-rw-r--r--DOCS/man/vo.rst3
-rw-r--r--video/out/opengl/video.c16
2 files changed, 13 insertions, 6 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index f59b9cbea7..cd798dcb91 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -791,7 +791,8 @@ Available video output drivers are:
influence performance and quality of the video output.
``fmt`` can be one of: rgb, rgba, rgb8, rgb10, rgb10_a2, rgb16, rgb16f,
rgb32f, rgba12, rgba16, rgba16f, rgba32f.
- Default: rgba16.
+ Default: ``auto``, which maps to rgba16 on desktop GL, and rgb10_a2 on
+ GLES (e.g. ANGLE).
``gamma=<0.1..2.0>``
Set a gamma value (default: 1.0). If gamma is adjusted in other ways
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index f7ca9d79d4..b7a4764c72 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -332,7 +332,7 @@ const struct gl_video_opts gl_video_opts_def = {
.dither_depth = -1,
.dither_size = 6,
.temporal_dither_period = 1,
- .fbo_format = GL_RGBA16,
+ .fbo_format = 0,
.sigmoid_center = 0.75,
.sigmoid_slope = 6.5,
.scaler = {
@@ -352,7 +352,7 @@ const struct gl_video_opts gl_video_opts_hq_def = {
.dither_depth = 0,
.dither_size = 6,
.temporal_dither_period = 1,
- .fbo_format = GL_RGBA16,
+ .fbo_format = 0,
.correct_downscaling = 1,
.sigmoid_center = 0.75,
.sigmoid_slope = 6.5,
@@ -423,7 +423,8 @@ const struct m_sub_options gl_video_conf = {
{"rgba12", GL_RGBA12},
{"rgba16", GL_RGBA16},
{"rgba16f", GL_RGBA16F},
- {"rgba32f", GL_RGBA32F})),
+ {"rgba32f", GL_RGBA32F},
+ {"auto", 0})),
OPT_CHOICE_OR_INT("dither-depth", dither_depth, 0, -1, 16,
({"no", -1}, {"auto", 0})),
OPT_CHOICE("dither", dither_algo, 0,
@@ -2359,13 +2360,18 @@ static void check_gl_features(struct gl_video *p)
bool have_mix = gl->glsl_version >= 130;
bool have_texrg = gl->mpgl_caps & MPGL_CAP_TEX_RG;
+ if (have_fbo) {
+ if (!p->opts.fbo_format)
+ p->opts.fbo_format = gl->es ? GL_RGB10_A2 : GL_RGBA16;
+ have_fbo = test_fbo(p);
+ }
+
if (gl->es && p->opts.pbo) {
p->opts.pbo = 0;
MP_WARN(p, "Disabling PBOs (GLES unsupported).\n");
}
- if (p->opts.dumb_mode || !have_fbo || !test_fbo(p) || !have_texrg)
- {
+ if (p->opts.dumb_mode || !have_fbo || !have_texrg) {
if (!p->opts.dumb_mode) {
MP_WARN(p, "High bit depth FBOs unsupported. Enabling dumb mode.\n"
"Most extended features will be disabled.\n");