From beb7094301a73d3af056982601ace45b8f3e7039 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 Jan 2016 20:47:12 +0100 Subject: vo_opengl: actually reset use_normalized_range field This was never reset - absolutely can't be right. If the renderer somehow switches back to another codepath, it certainly has to be reset. Maybe this was hard to hit, as the normalization is going to be idempotent in simpler cases (like rendering RGBA input). Also get rid of the "merged" variable. --- video/out/opengl/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 283a7cf0e5..9a3b0c16f2 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1337,6 +1337,8 @@ static bool pass_prescale_luma(struct gl_video *p, float tex_mul, // sample from video textures, set "color" variable to yuv value static void pass_read_video(struct gl_video *p) { + p->use_normalized_range = false; + struct gl_transform chromafix; pass_set_image_textures(p, &p->image, &chromafix); @@ -1363,7 +1365,6 @@ static void pass_read_video(struct gl_video *p) int c_h = p->pass_tex[1].src.y1 - p->pass_tex[1].src.y0; const struct scaler_config *cscale = &p->opts.scaler[2]; - bool merged = false; if (p->plane_count > 2) { // For simplicity and performance, we merge the chroma planes // into a single texture before scaling or debanding, so the shader @@ -1379,12 +1380,11 @@ static void pass_read_video(struct gl_video *p) assert(c_h == p->pass_tex[2].src.y1 - p->pass_tex[2].src.y0); finish_pass_fbo(p, &p->chroma_merge_fbo, c_w, c_h, 1, 0); p->use_normalized_range = true; - merged = true; } if (p->opts.deband) { pass_sample_deband(p->sc, p->opts.deband_opts, 1, p->gl_target, - merged ? 1.0 : tex_mul, + p->use_normalized_range ? 1.0 : tex_mul, p->texture_w, p->texture_h, &p->lfg); GLSL(color.zw = vec2(0.0, 1.0);) // skip unused finish_pass_fbo(p, &p->chroma_deband_fbo, c_w, c_h, 1, 0); -- cgit v1.2.3