• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3#ifdef __clang__
4#pragma clang diagnostic ignored "-Wall"
5#endif
6using namespace metal;
7struct Uniforms {
8    half4 colorWhite;
9};
10struct Inputs {
11};
12struct Outputs {
13    half4 sk_FragColor [[color(0)]];
14};
15fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
16    Outputs _out;
17    (void)_out;
18    half4 x = _uniforms.colorWhite;
19    for (half r = -5.0h;r < 5.0h; r += 1.0h) {
20        x.x = saturate(r);
21        if (x.x == 0.0h) break;
22    }
23    for (half b = 5.0h;b >= 0.0h; b -= 1.0h) {
24        x.z = b;
25        if (x.w == 1.0h) continue;
26        x.y = 0.0h;
27    }
28    _out.sk_FragColor = x;
29    return _out;
30}
31