mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-26 17:31:31 +11:00
fix(sinc): kernel is a reserved word for Metal shaders
* SPIRV-Cross should handle this
This commit is contained in:
parent
93d3c10cd0
commit
1e9ed9423d
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue