25 lines
608 B
Metal
25 lines
608 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct Inputs {
|
|
};
|
|
struct Outputs {
|
|
half4 sk_FragColor [[color(0)]];
|
|
};
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
|
Outputs _out;
|
|
(void)_out;
|
|
half4 x = half4(1.0h, 1.0h, 1.0h, 1.0h);
|
|
do {
|
|
x.x = x.x - 0.25h;
|
|
if (x.x <= 0.0h) break;
|
|
} while (x.w == 1.0h);
|
|
do {
|
|
x.z = x.z - 0.25h;
|
|
if (x.w == 1.0h) continue;
|
|
x.y = 0.0h;
|
|
} while (x.z > 0.0h);
|
|
_out.sk_FragColor = x;
|
|
return _out;
|
|
}
|