From 2c99464b475d01e1fb3f96904dc905eef6197008 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Aug 2014 00:40:37 +0200 Subject: vo_opengl: fix shader Regression since commit f14722a4. For some reason, this worked on nvidia, but rightfully failed on mesa. At least in C, the ## operator indeed needs two macro arguments, and you can't just concatenate with non-arguments. This change will most likely fix it. CC: @bjin --- video/out/gl_video_shaders.glsl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl index 3d9d9bf07a..6e135f0d11 100644 --- a/video/out/gl_video_shaders.glsl +++ b/video/out/gl_video_shaders.glsl @@ -352,13 +352,15 @@ vec4 sample_sharpen5(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord, float param return p + t * param1; } -#define SAMPLE_FILTER_LC(NAME) \ - vec4 NAME##_l(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) { \ - return NAME(tex, texsize, texcoord, filter_param1_l); \ - } \ - \ - vec4 NAME##_c(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) { \ - return NAME(tex, texsize, texcoord, filter_param1_c); \ +#define CONCAT(a, b) a ## b + +#define SAMPLE_FILTER_LC(NAME) \ + vec4 CONCAT(NAME, _l)(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) { \ + return NAME(tex, texsize, texcoord, filter_param1_l); \ + } \ + \ + vec4 CONCAT(NAME, _c)(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) { \ + return NAME(tex, texsize, texcoord, filter_param1_c); \ } SAMPLE_FILTER_LC(sample_bilinear) -- cgit v1.2.3