mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
vo_opengl: pass the correct target to deband functions
Apple crap (namely hardware decoding interop) forces us to use rectangle textures for input. But after that we continue with normal textures. This was not considered for debanding, and the sampler type used for it can be different depending on the exact render chain. Simply use the target type of the input texture.
This commit is contained in:
parent
0d40140668
commit
d6af58c699
@ -1348,7 +1348,7 @@ static bool pass_prescale_luma(struct gl_video *p, float tex_mul,
|
||||
|
||||
if (p->opts.deband) {
|
||||
// apply debanding before upscaling.
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 0, p->gl_target,
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 0, p->pass_tex[0].gl_target,
|
||||
tex_mul, p->texture_w, p->texture_h, &p->lfg);
|
||||
finish_pass_fbo(p, &p->deband_fbo, p->texture_w,
|
||||
p->texture_h, 0, 0);
|
||||
@ -1468,7 +1468,7 @@ static void pass_read_video(struct gl_video *p)
|
||||
}
|
||||
|
||||
if (p->opts.deband) {
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 1, p->gl_target,
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 1, p->pass_tex[1].gl_target,
|
||||
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
|
||||
@ -1505,8 +1505,8 @@ static void pass_read_video(struct gl_video *p)
|
||||
GLSL(vec4 main;)
|
||||
GLSLF("{\n");
|
||||
if (!prescaled && p->opts.deband) {
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 0, p->gl_target, tex_mul,
|
||||
p->texture_w, p->texture_h, &p->lfg);
|
||||
pass_sample_deband(p->sc, p->opts.deband_opts, 0, p->pass_tex[0].gl_target,
|
||||
tex_mul, p->texture_w, p->texture_h, &p->lfg);
|
||||
p->use_normalized_range = true;
|
||||
} else {
|
||||
if (!prescaled) {
|
||||
|
Loading…
Reference in New Issue
Block a user