| 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 Registers |
| 9 |
{ |
| 10 |
float foo; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_out |
| 14 |
{ |
| 15 |
float FragColor [[color(0)]]; |
| 16 |
}; |
| 17 |
|
| 18 |
static inline __attribute__((always_inline)) |
| 19 |
float add_value(float v, float w) |
| 20 |
{ |
| 21 |
return v + w; |
| 22 |
} |
| 23 |
|
| 24 |
fragment main0_out main0(constant Registers& registers [[buffer(0)]]) |
| 25 |
{ |
| 26 |
main0_out out = {}; |
| 27 |
out.FragColor = add_value(10.0, registers.foo); |
| 28 |
return out; |
| 29 |
} |
| 30 |
|