2020-10-30 19:58:49 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct Inputs {
|
|
|
|
};
|
|
|
|
struct Outputs {
|
|
|
|
float4 sk_FragColor [[color(0)]];
|
|
|
|
};
|
|
|
|
struct Globals {
|
|
|
|
texture2d<float> tex;
|
|
|
|
sampler texSmplr;
|
|
|
|
};
|
2020-12-07 22:52:25 +00:00
|
|
|
|
2020-10-30 19:58:49 +00:00
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], texture2d<float> tex[[texture(0)]], sampler texSmplr[[sampler(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
2021-01-19 18:07:55 +00:00
|
|
|
Globals _globals{tex, texSmplr};
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_globals;
|
2021-01-19 18:07:55 +00:00
|
|
|
Outputs _out;
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_out;
|
2020-12-11 16:17:14 +00:00
|
|
|
float3 _skTemp0;
|
2021-01-19 18:07:55 +00:00
|
|
|
float4 a = _globals.tex.sample(_globals.texSmplr, float2(0.0));
|
|
|
|
float4 b = _globals.tex.sample(_globals.texSmplr, (_skTemp0 = float3(0.0), _skTemp0.xy / _skTemp0.z));
|
|
|
|
_out.sk_FragColor = float4(a.xy, b.zw);
|
|
|
|
return _out;
|
2020-10-30 19:58:49 +00:00
|
|
|
}
|