| 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 |
float4 FragColor [[color(0)]]; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_in |
| 14 |
{ |
| 15 |
float4 vColor [[user(locn0)]]; |
| 16 |
float2 vTex [[user(locn1)]]; |
| 17 |
}; |
| 18 |
|
| 19 |
static inline __attribute__((always_inline)) |
| 20 |
float4 sample_texture(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv) |
| 21 |
{ |
| 22 |
return tex.sample(texSmplr, uv); |
| 23 |
} |
| 24 |
|
| 25 |
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]]) |
| 26 |
{ |
| 27 |
main0_out out = {}; |
| 28 |
float2 param = in.vTex; |
| 29 |
out.FragColor = in.vColor * sample_texture(uTex, uTexSmplr, param); |
| 30 |
return out; |
| 31 |
} |
| 32 |
|