From 5d8b50bda8184b5fe5206cd9349666764a590af9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Mar 2013 23:30:54 +0100 Subject: gl_video: fix OSX by not using undefined name in GLSL "#if" The OSX shader compiler was giving this error: ERROR: 0:235: '' : syntax error incorrect preprocessor directive on this line: [235] #if USE_CONV == CONV_PLANAR USE_CONV was undefined in some cases. The expected behavior is that the shader preprocessor interprets this as branch not taken (AFAIK exactly as in C), which is probably what the standard would dictate. This is possible an OSX bug. But admittedly, I'm not sure whether this is really standard behavior (in C or GLSL), and doing this is extremely weird at best, so make sure that USE_CONV is always defined. Should fix behavior on OSX. --- video/out/gl_video.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video') diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 22f4100e9a..5f63c9517f 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -703,6 +703,8 @@ 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); -- cgit v1.2.3