fix(sinc): kernel is a reserved word for Metal shaders

* SPIRV-Cross should handle this
This commit is contained in:
Stuart Carnie 2018-07-14 15:40:56 -07:00
parent 93d3c10cd0
commit 1e9ed9423d

View file

@ -25,7 +25,7 @@ float sinc(float x)
return sin(x) / x; return sin(x) / x;
} }
float kernel(float x) float kernel_(float x)
{ {
x = max(abs(x) * PI, 0.0001); x = max(abs(x) * PI, 0.0001);
return sinc(x) * sinc(0.5 * x); return sinc(x) * sinc(0.5 * x);
@ -40,10 +40,10 @@ void main()
#define TEX(x, y) textureLodOffset(Source, tex, 0.0, ivec2(x, y)).rgb #define TEX(x, y) textureLodOffset(Source, tex, 0.0, ivec2(x, y)).rgb
vec3 color = vec3 color =
kernel(a + 1.0) * TEX(-1, 0) + kernel_(a + 1.0) * TEX(-1, 0) +
kernel(a ) * TEX( 0, 0) + kernel_(a ) * TEX( 0, 0) +
kernel(a - 1.0) * TEX( 1, 0) + kernel_(a - 1.0) * TEX( 1, 0) +
kernel(a - 2.0) * TEX( 2, 0); kernel_(a - 2.0) * TEX( 2, 0);
FragColor = vec4(color, 1.0); FragColor = vec4(color, 1.0);
} }