From 182bbb59175f4fcb7d727d89dda7bb9a1596a6de Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 17 Jun 2017 13:54:21 +0200 Subject: vo_opengl: fall back to ordered dither instead of blowing up In GLES 2 mode, we can do dither, but "fruit" dithering is still out of the question, because it does not support any high depth textures. (Actually we probably could use an 8 bit texture too for this, at least with small matrix sizes, but it's still too much of a pain to convert the data, so why bother.) This is actually a regression; before this, forcibly enabling dumb mode due to low GL caps actually happened to avoid this case. Fixes #4519. --- video/out/opengl/video.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index f4695b1333..51d484d078 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2192,14 +2192,19 @@ static void pass_dither(struct gl_video *p) const struct gl_format *fmt = gl_find_unorm_format(gl, 2, 1); if (!fmt || gl->es) fmt = gl_find_float16_format(gl, 1); - tex_size = size; if (fmt) { + tex_size = size; tex_iformat = fmt->internal_format; tex_format = fmt->format; + tex_type = GL_FLOAT; + tex_data = p->last_dither_matrix; + } else { + MP_VERBOSE(p, "GL too old. Falling back to ordered dither.\n"); + p->opts.dither_algo = DITHER_ORDERED; } - tex_type = GL_FLOAT; - tex_data = p->last_dither_matrix; - } else { + } + + if (p->opts.dither_algo == DITHER_ORDERED) { assert(sizeof(temp) >= 8 * 8); mp_make_ordered_dither_matrix(temp, 8); -- cgit v1.2.3