| 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 sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr) |
| 20 |
{ |
| 21 |
return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z); |
| 22 |
} |
| 23 |
|
| 24 |
static inline __attribute__((always_inline)) |
| 25 |
float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler) |
| 26 |
{ |
| 27 |
return uTexture.sample_compare(uSampler, vUV.xy, vUV.z); |
| 28 |
} |
| 29 |
|
| 30 |
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(1)]]) |
| 31 |
{ |
| 32 |
main0_out out = {}; |
| 33 |
out.FragColor = sample_combined(in.vUV, uShadow, uShadowSmplr) + sample_separate(in.vUV, uTexture, uSampler); |
| 34 |
return out; |
| 35 |
} |
| 36 |
|