blob: 6cd4bf2e4f28bdd59819d97493cb65adb700b43c [file] [log] [blame]
Michael Ludwigbf58add2021-03-16 10:40:11 -04001#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
Brian Osman8c595fe2021-03-15 14:58:57 -04004struct Uniforms {
Brian Osmanc0213602020-10-06 14:43:32 -04005 float4 src;
6 float4 dst;
John Stilesaeae3a52020-09-25 13:35:58 -04007};
Brian Osman8c595fe2021-03-15 14:58:57 -04008struct Inputs {
9};
John Stilesaeae3a52020-09-25 13:35:58 -040010struct Outputs {
11 float4 sk_FragColor [[color(0)]];
12};
Brian Osman8c595fe2021-03-15 14:58:57 -040013fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
John Stilesf7410bd2021-01-19 13:07:55 -050014 Outputs _out;
John Stiles37279172021-01-21 22:24:28 -050015 (void)_out;
Brian Osman8c595fe2021-03-15 14:58:57 -040016 _out.sk_FragColor = _uniforms.src + (1.0 - _uniforms.src.w) * _uniforms.dst;
John Stilesf7410bd2021-01-19 13:07:55 -050017 return _out;
John Stilesaeae3a52020-09-25 13:35:58 -040018}