From afd685490dfccd4eb5980a93e4e8f053d45b2b3f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 5 Apr 2016 20:57:02 +0200 Subject: vo_opengl: fix nnedi + rectangle textures Shader compilation error due to incompatible samplers. --- video/out/opengl/nnedi3.c | 4 ++-- video/out/opengl/nnedi3.h | 2 +- video/out/opengl/video.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'video/out/opengl') diff --git a/video/out/opengl/nnedi3.c b/video/out/opengl/nnedi3.c index 702a8dd55f..68a90cab42 100644 --- a/video/out/opengl/nnedi3.c +++ b/video/out/opengl/nnedi3.c @@ -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}}; diff --git a/video/out/opengl/nnedi3.h b/video/out/opengl/nnedi3.h index b75094a7e4..c3895a0773 100644 --- a/video/out/opengl/nnedi3.h +++ b/video/out/opengl/nnedi3.h @@ -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 diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index c2d5fc211d..f9ff6aec4e 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -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(); -- cgit v1.2.3