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.
This commit is contained in:
wm4 2017-06-17 13:54:21 +02:00
parent 2a0028aa13
commit 182bbb5917
1 changed files with 9 additions and 4 deletions

View File

@ -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);