diff options
author | wm4 <wm4@nowhere> | 2015-12-08 03:18:47 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-08 03:18:47 +0100 |
commit | 0d7d935e8863ae759f284739769f250b1302a9ec (patch) | |
tree | 848efd98de35ec4cbbb6207ab5fbc8bc6280d369 /video/out/opengl/utils.c | |
parent | 3d66a5d14eaa6081dd8b14dd8dd03cf996e4945e (diff) | |
download | mpv-0d7d935e8863ae759f284739769f250b1302a9ec.tar.bz2 mpv-0d7d935e8863ae759f284739769f250b1302a9ec.tar.xz |
vo_opengl: fix shader compilation regression
The recent LUT adjustment changes broke interpolation.
The concatenation of the shader stages is a bit messy, and it seems like
sampler_prelude is not a good place to add this macro. Always add the
macro to every shader instead. (While this doesn't seem too elegant,
this isn't too inelegant either, and goes these problems out of the
way.)
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index cdd549a791..c168cc60eb 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -960,6 +960,11 @@ void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc) else ADD(frag, "uniform %s %s;\n", u->glsl_type, u->name); } + + // Additional helpers. + ADD(frag, "#define LUT_POS(x, lut_size) \\\n"); + ADD(frag, " mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))\n"); + // custom shader header if (sc->header_text[0]) { ADD(frag, "// header\n"); |