diff options
author | Niklas Haas <git@haasn.xyz> | 2017-07-06 11:27:24 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-07-06 11:30:33 +0200 |
commit | aa2bdec26cf2544cffa4b2613086f226127e2ea8 (patch) | |
tree | 30b981bef8c110d31aad02155ebb0205a87e9432 /video/out | |
parent | ef43854b3439907fa8bf77e25d450f3c71395218 (diff) | |
download | mpv-aa2bdec26cf2544cffa4b2613086f226127e2ea8.tar.bz2 mpv-aa2bdec26cf2544cffa4b2613086f226127e2ea8.tar.xz |
vo_opengl: also expose NAME_mul for user shaders
This is exposed so that bjin/mpv-prescalers can use textureGatherOffset
for performance.
Since there are now quite a lot of parameters where it isn't quite clear
why they're all defined, add a paragraph to the man page that explains
them a bit.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/video.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index f2f5260c74..876da267a3 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1171,10 +1171,11 @@ static void hook_prelude(struct gl_video *p, const char *name, int id, GLSLHF("#define %s_size texture_size%d\n", name, id); GLSLHF("#define %s_rot texture_rot%d\n", name, id); GLSLHF("#define %s_pt pixel_size%d\n", name, id); + GLSLHF("#define %s_mul %f\n", name, tex.multiplier); // Set up the sampling functions - GLSLHF("#define %s_tex(pos) (%f * vec4(texture(%s_raw, pos)).%s)\n", - name, tex.multiplier, name, get_tex_swizzle(&tex)); + GLSLHF("#define %s_tex(pos) (%s_mul * vec4(texture(%s_raw, pos)).%s)\n", + name, name, name, get_tex_swizzle(&tex)); // Since the extra matrix multiplication impacts performance, // skip it unless the texture was actually rotated |