| 1 |
#pragma clang diagnostic ignored "-Wmissing-prototypes" |
| 2 |
|
| 3 |
#include <metal_stdlib> |
| 4 |
#include <simd/simd.h> |
| 5 |
|
| 6 |
using namespace metal; |
| 7 |
|
| 8 |
struct main0_out |
| 9 |
{ |
| 10 |
float FragColor [[color(0)]]; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_in |
| 14 |
{ |
| 15 |
float3 vUV [[user(locn0)]]; |
| 16 |
}; |
| 17 |
|
| 18 |
static inline __attribute__((always_inline)) |
| 19 |
float Samp(thread const float3& uv, thread depth2d<float> uTex, thread sampler uSamp) |
| 20 |
{ |
| 21 |
return uTex.sample_compare(uSamp, uv.xy, uv.z); |
| 22 |
} |
| 23 |
|
| 24 |
static inline __attribute__((always_inline)) |
| 25 |
float Samp2(thread const float3& uv, thread depth2d<float> uSampler, thread const sampler uSamplerSmplr, thread float3& vUV) |
| 26 |
{ |
| 27 |
return uSampler.sample_compare(uSamplerSmplr, vUV.xy, vUV.z); |
| 28 |
} |
| 29 |
|
| 30 |
static inline __attribute__((always_inline)) |
| 31 |
float Samp3(thread const depth2d<float> uT, thread const sampler uS, thread const float3& uv, thread float3& vUV) |
| 32 |
{ |
| 33 |
return uT.sample_compare(uS, vUV.xy, vUV.z); |
| 34 |
} |
| 35 |
|
| 36 |
static inline __attribute__((always_inline)) |
| 37 |
float Samp4(thread const depth2d<float> uS, thread const sampler uSSmplr, thread const float3& uv, thread float3& vUV) |
| 38 |
{ |
| 39 |
return uS.sample_compare(uSSmplr, vUV.xy, vUV.z); |
| 40 |
} |
| 41 |
|
| 42 |
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uTex [[texture(0)]], depth2d<float> uSampler [[texture(1)]], sampler uSamp [[sampler(0)]], sampler uSamplerSmplr [[sampler(1)]]) |
| 43 |
{ |
| 44 |
main0_out out = {}; |
| 45 |
out.FragColor = uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z); |
| 46 |
out.FragColor += uTex.sample_compare(uSamp, in.vUV.xy, in.vUV.z); |
| 47 |
float3 param = in.vUV; |
| 48 |
out.FragColor += Samp(param, uTex, uSamp); |
| 49 |
float3 param_1 = in.vUV; |
| 50 |
out.FragColor += Samp2(param_1, uSampler, uSamplerSmplr, in.vUV); |
| 51 |
float3 param_2 = in.vUV; |
| 52 |
out.FragColor += Samp3(uTex, uSamp, param_2, in.vUV); |
| 53 |
float3 param_3 = in.vUV; |
| 54 |
out.FragColor += Samp4(uSampler, uSamplerSmplr, param_3, in.vUV); |
| 55 |
return out; |
| 56 |
} |
| 57 |
|