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 | c021360 | 2020-10-06 14:43:32 -0400 | [diff] [blame] | 5 | float4 src; |
| 6 | float4 dst; |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 7 | }; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 8 | struct Inputs { |
| 9 | }; |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 10 | struct Outputs { |
| 11 | float4 sk_FragColor [[color(0)]]; |
| 12 | }; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 13 | 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] | 14 | Outputs _out; |
John Stiles | 3727917 | 2021-01-21 22:24:28 -0500 | [diff] [blame] | 15 | (void)_out; |
Brian Osman | 8c595fe | 2021-03-15 14:58:57 -0400 | [diff] [blame] | 16 | _out.sk_FragColor = _uniforms.src + (1.0 - _uniforms.src.w) * _uniforms.dst; |
John Stiles | f7410bd | 2021-01-19 13:07:55 -0500 | [diff] [blame] | 17 | return _out; |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 18 | } |