1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

vo_opengl: fix nnedi + rectangle textures

Shader compilation error due to incompatible samplers.
This commit is contained in:
wm4 2016-04-05 20:57:02 +02:00
parent da3489353b
commit afd685490d
3 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ const float* get_nnedi3_weights(const struct nnedi3_opts *conf, int *size)
void pass_nnedi3(GL *gl, struct gl_shader_cache *sc, int planes, int tex_num,
int step, float tex_mul, const struct nnedi3_opts *conf,
struct gl_transform *transform)
struct gl_transform *transform, GLenum tex_target)
{
assert(0 <= step && step < 2);
@ -131,7 +131,7 @@ void pass_nnedi3(GL *gl, struct gl_shader_cache *sc, int planes, int tex_num,
GLSLH(#pragma optionNV(fastprecision on))
}
GLSLHF("float nnedi3(sampler2D tex, vec2 pos, vec2 tex_size, vec2 pixel_size, int plane, float tex_mul) {\n");
GLSLHF("float nnedi3(%s tex, vec2 pos, vec2 tex_size, vec2 pixel_size, int plane, float tex_mul) {\n", mp_sampler_type(tex_target));
if (step == 0) {
*transform = (struct gl_transform){{{1.0,0.0}, {0.0,2.0}}, {0.0,-0.5}};

View File

@ -40,6 +40,6 @@ const float* get_nnedi3_weights(const struct nnedi3_opts *conf, int *size);
void pass_nnedi3(GL *gl, struct gl_shader_cache *sc, int planes, int tex_num,
int step, float tex_mul, const struct nnedi3_opts *conf,
struct gl_transform *transform);
struct gl_transform *transform, GLenum tex_target);
#endif

View File

@ -1412,7 +1412,7 @@ static void pass_prescale_luma(struct gl_video *p, struct img_tex *tex,
case 2:
upload_nnedi3_weights(p);
pass_nnedi3(p->gl, p->sc, planes, id, step, tex->multiplier,
p->opts.nnedi3_opts, &step_transform);
p->opts.nnedi3_opts, &step_transform, tex->gl_target);
break;
default:
abort();