From 3d844cddf8179c0a6d1d65ed9c2b13b15f70180e Mon Sep 17 00:00:00 2001 From: Bin Jin Date: Sat, 11 Jun 2016 23:42:59 +0000 Subject: vo_opengl: make size of OUTPUT available to user shaders --- video/out/opengl/video.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 21eda6bc7d..c9179c7800 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1688,6 +1688,15 @@ static bool eval_szexpr(struct gl_video *p, struct img_tex tex, struct bstr name = expr[i].val.varname; struct img_tex var_tex; + // The size of OUTPUT is determined. It could be useful for certain + // user shaders to skip passes. + if (bstr_equals0(name, "OUTPUT")) { + int vp_w = p->dst_rect.x1 - p->dst_rect.x0; + int vp_h = p->dst_rect.y1 - p->dst_rect.y0; + stack[idx++] = (expr[i].tag == SZEXP_VAR_W) ? vp_w : vp_h; + continue; + } + // HOOKED is a special case if (bstr_equals0(name, "HOOKED")) { var_tex = tex; -- cgit v1.2.3