John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | using namespace metal; |
| 4 | struct Inputs { |
| 5 | }; |
| 6 | struct Outputs { |
| 7 | float4 sk_FragColor [[color(0)]]; |
| 8 | }; |
| 9 | fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { |
John Stiles | f7410bd | 2021-01-19 13:07:55 -0500 | [diff] [blame] | 10 | Outputs _out; |
John Stiles | 3727917 | 2021-01-21 22:24:28 -0500 | [diff] [blame^] | 11 | (void)_out; |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 12 | float x; |
| 13 | switch (int(sqrt(1.0))) { |
| 14 | case 0: |
| 15 | x = 0.0; |
| 16 | break; |
| 17 | case 1: |
| 18 | x = 1.0; |
| 19 | break; |
| 20 | default: |
| 21 | x = 2.0; |
| 22 | } |
John Stiles | f7410bd | 2021-01-19 13:07:55 -0500 | [diff] [blame] | 23 | _out.sk_FragColor = float4(x); |
| 24 | return _out; |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 25 | } |