diff options
author | wm4 <wm4@nowhere> | 2012-11-12 00:10:57 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-12 00:27:26 +0100 |
commit | 0165ab5402c3ec472e877042b38cc03c952ac54c (patch) | |
tree | 3715cc3b0c25c7ef027bf8b98d4eea6093c27d0c /libvo/vo_opengl_shaders.glsl | |
parent | a55811790902b78915a1613f3551fe763ccda41a (diff) | |
download | mpv-0165ab5402c3ec472e877042b38cc03c952ac54c.tar.bz2 mpv-0165ab5402c3ec472e877042b38cc03c952ac54c.tar.xz |
vo_opengl: fix compatibility with OpenGL 2.1
The srgb_compand() function passes bvec to mix(), which is apparently
not available on GL 2.1 / GLSL 1.20:
0:0(0): error: no matching function for call to `mix(vec3, vec3, bvec3)'
0:0(0): error: candidates are: float mix(float, float, float)
0:0(0): error: vec2 mix(vec2, vec2, vec2)
0:0(0): error: vec3 mix(vec3, vec3, vec3)
0:0(0): error: vec4 mix(vec4, vec4, vec4)
0:0(0): error: vec2 mix(vec2, vec2, float)
0:0(0): error: vec3 mix(vec3, vec3, float)
0:0(0): error: vec4 mix(vec4, vec4, float)
Also add back disabling color management on older GL, as the
srgb_compand() function is needed for that.
Diffstat (limited to 'libvo/vo_opengl_shaders.glsl')
-rw-r--r-- | libvo/vo_opengl_shaders.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libvo/vo_opengl_shaders.glsl b/libvo/vo_opengl_shaders.glsl index 5dd67bbd52..1f302889e4 100644 --- a/libvo/vo_opengl_shaders.glsl +++ b/libvo/vo_opengl_shaders.glsl @@ -37,11 +37,14 @@ # define in varying #endif +// Earlier GLSL doesn't support mix() with bvec +#if __VERSION__ >= 130 vec3 srgb_compand(vec3 v) { return mix(1.055 * pow(v, vec3(1.0/2.4)) - vec3(0.055), v * 12.92, lessThanEqual(v, vec3(0.0031308))); } +#endif #!section vertex_all |