| 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 |
static inline __attribute__((always_inline)) |
| 14 |
float sample_depth_from_function(thread const depth2d<float> uT, thread const sampler uS) |
| 15 |
{ |
| 16 |
return uT.sample_compare(uS, float3(0.5).xy, float3(0.5).z); |
| 17 |
} |
| 18 |
|
| 19 |
static inline __attribute__((always_inline)) |
| 20 |
float sample_color_from_function(thread const texture2d<float> uT, thread const sampler uS) |
| 21 |
{ |
| 22 |
return uT.sample(uS, float2(0.5)).x; |
| 23 |
} |
| 24 |
|
| 25 |
fragment main0_out main0(depth2d<float> uDepth [[texture(0)]], texture2d<float> uColor [[texture(1)]], sampler uSamplerShadow [[sampler(0)]], sampler uSampler [[sampler(1)]]) |
| 26 |
{ |
| 27 |
main0_out out = {}; |
| 28 |
out.FragColor = sample_depth_from_function(uDepth, uSamplerShadow) + sample_color_from_function(uColor, uSampler); |
| 29 |
return out; |
| 30 |
} |
| 31 |
|