1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:42:17 +00:00

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
This commit is contained in:
wm4 2014-08-28 00:40:37 +02:00
parent f8a1bd1253
commit 2c99464b47

View File

@ -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)