From 6b8dadd7c18f682d51c695dbfa7b3f3ea2794969 Mon Sep 17 00:00:00 2001 From: igv Date: Fri, 15 Jul 2016 09:26:35 +0300 Subject: vo_opengl: add tex_offset uniform variable to user shaders --- video/out/opengl/video.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index b9764063c0..f6db1514f5 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1229,6 +1229,11 @@ static void load_shader(struct gl_video *p, struct bstr body) gl_sc_uniform_vec2(p->sc, "target_size", (GLfloat[]){p->dst_rect.x1 - p->dst_rect.x0, p->dst_rect.y1 - p->dst_rect.y0}); + gl_sc_uniform_vec2(p->sc, "tex_offset", + (GLfloat[]){p->src_rect.x0 * p->texture_offset.m[0][0] + + p->texture_offset.t[0], + p->src_rect.y0 * p->texture_offset.m[1][1] + + p->texture_offset.t[1]}); } // Semantic equality -- cgit v1.2.3