Michael Ludwig | bf58add | 2021-03-16 10:40:11 -0400 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | using namespace metal; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 4 | struct Uniforms { |
Brian Osman | 9155b33 | 2021-08-25 02:54:58 +0000 | [diff] [blame^] | 5 | float a; |
John Stiles | 3679cd1 | 2020-12-09 16:22:12 -0500 | [diff] [blame] | 6 | }; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 7 | struct Inputs { |
| 8 | }; |
John Stiles | 3679cd1 | 2020-12-09 16:22:12 -0500 | [diff] [blame] | 9 | struct Outputs { |
| 10 | float4 sk_FragColor [[color(0)]]; |
| 11 | }; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 12 | fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { |
John Stiles | f7410bd | 2021-01-19 13:07:55 -0500 | [diff] [blame] | 13 | Outputs _out; |
John Stiles | 3727917 | 2021-01-21 22:24:28 -0500 | [diff] [blame] | 14 | (void)_out; |
Brian Osman | 9155b33 | 2021-08-25 02:54:58 +0000 | [diff] [blame^] | 15 | _out.sk_FragColor.x = float(isnan(_uniforms.a) ? 1 : 0); |
John Stiles | f7410bd | 2021-01-19 13:07:55 -0500 | [diff] [blame] | 16 | return _out; |
John Stiles | 3679cd1 | 2020-12-09 16:22:12 -0500 | [diff] [blame] | 17 | } |