| 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 |
float vColor [[user(locn0)]]; |
| 16 |
}; |
| 17 |
|
| 18 |
#line 6 "test.frag" |
| 19 |
static inline __attribute__((always_inline)) |
| 20 |
void func(thread float& FragColor, thread float& vColor) |
| 21 |
{ |
| 22 |
#line 8 "test.frag" |
| 23 |
FragColor = 1.0; |
| 24 |
#line 9 "test.frag" |
| 25 |
FragColor = 2.0; |
| 26 |
#line 10 "test.frag" |
| 27 |
if (vColor < 0.0) |
| 28 |
{ |
| 29 |
#line 12 "test.frag" |
| 30 |
FragColor = 3.0; |
| 31 |
} |
| 32 |
else |
| 33 |
{ |
| 34 |
#line 16 "test.frag" |
| 35 |
FragColor = 4.0; |
| 36 |
} |
| 37 |
#line 19 "test.frag" |
| 38 |
for (int i = 0; float(i) < (40.0 + vColor); i += (int(vColor) + 5)) |
| 39 |
{ |
| 40 |
#line 21 "test.frag" |
| 41 |
FragColor += 0.20000000298023223876953125; |
| 42 |
#line 22 "test.frag" |
| 43 |
FragColor += 0.300000011920928955078125; |
| 44 |
} |
| 45 |
#line 25 "test.frag" |
| 46 |
switch (int(vColor)) |
| 47 |
{ |
| 48 |
case 0: |
| 49 |
{ |
| 50 |
#line 28 "test.frag" |
| 51 |
FragColor += 0.20000000298023223876953125; |
| 52 |
#line 29 "test.frag" |
| 53 |
break; |
| 54 |
} |
| 55 |
case 1: |
| 56 |
{ |
| 57 |
#line 32 "test.frag" |
| 58 |
FragColor += 0.4000000059604644775390625; |
| 59 |
#line 33 "test.frag" |
| 60 |
break; |
| 61 |
} |
| 62 |
default: |
| 63 |
{ |
| 64 |
#line 36 "test.frag" |
| 65 |
FragColor += 0.800000011920928955078125; |
| 66 |
#line 37 "test.frag" |
| 67 |
break; |
| 68 |
} |
| 69 |
} |
| 70 |
do |
| 71 |
{ |
| 72 |
#line 42 "test.frag" |
| 73 |
FragColor += (10.0 + vColor); |
| 74 |
} while (FragColor < 100.0); |
| 75 |
} |
| 76 |
|
| 77 |
#line 46 "test.frag" |
| 78 |
fragment main0_out main0(main0_in in [[stage_in]]) |
| 79 |
{ |
| 80 |
main0_out out = {}; |
| 81 |
#line 48 "test.frag" |
| 82 |
func(out.FragColor, in.vColor); |
| 83 |
return out; |
| 84 |
} |
| 85 |
|