summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-28 23:43:36 +0100
committerwm4 <wm4@nowhere>2013-03-28 23:52:40 +0100
commitb617863c247c4a509c118557afa030df16eca118 (patch)
tree46d0d1a3c6ba5897e5679d18e960cd1f69d2f957
parent5d8b50bda8184b5fe5206cd9349666764a590af9 (diff)
downloadmpv-b617863c247c4a509c118557afa030df16eca118.tar.bz2
mpv-b617863c247c4a509c118557afa030df16eca118.tar.xz
gl_video: actually fix shader compilation on OSX
The previous attempt was missing some code paths, so there were still shaders generated that triggered the shader compilation error. Fix it instead by special handling USE_CONV in the shader. By the way, the shader compiler did not accept: #if defined(USE_CONV) && (USE_CONV == ...) In my opinion this should be perfectly fine, but it gives the same error as before. So test USE_CONV separately with #ifndef.
-rw-r--r--video/out/gl_video.c2
-rw-r--r--video/out/gl_video_shaders.glsl3
2 files changed, 3 insertions, 2 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 5f63c9517f..22f4100e9a 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -703,8 +703,6 @@ static void compile_shaders(struct gl_video *p)
shader_def(&header_conv, "USE_CONV", "CONV_NV12");
} else if (p->plane_count > 1) {
shader_def(&header_conv, "USE_CONV", "CONV_PLANAR");
- } else {
- shader_def(&header_conv, "USE_CONV", "0");
}
shader_def_opt(&header_conv, "USE_GBRP", p->image_format == IMGFMT_GBRP);
diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl
index ee7baa7f6c..2f10e5fdf6 100644
--- a/video/out/gl_video_shaders.glsl
+++ b/video/out/gl_video_shaders.glsl
@@ -319,6 +319,9 @@ vec4 sample_sharpen5(sampler2D tex, vec2 texsize, vec2 texcoord) {
}
void main() {
+#ifndef USE_CONV
+#define USE_CONV 0
+#endif
#if USE_CONV == CONV_PLANAR
vec3 color = vec3(SAMPLE_L(textures[0], textures_size[0], texcoord).r,
SAMPLE_C(textures[1], textures_size[1], texcoord).r,