2020-11-24 19:18:23 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
2021-02-03 22:44:47 +00:00
|
|
|
struct Uniforms {
|
|
|
|
float4 colorGreen;
|
|
|
|
};
|
2020-11-24 19:18:23 +00:00
|
|
|
struct Inputs {
|
|
|
|
};
|
|
|
|
struct Outputs {
|
|
|
|
float4 sk_FragColor [[color(0)]];
|
|
|
|
};
|
2021-02-03 22:44:47 +00:00
|
|
|
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
2021-01-19 18:07:55 +00:00
|
|
|
Outputs _out;
|
2021-01-22 03:24:28 +00:00
|
|
|
(void)_out;
|
2020-11-24 19:18:23 +00:00
|
|
|
float _1_x = 1.0;
|
2020-12-15 20:21:03 +00:00
|
|
|
_1_x = abs(1.0);
|
|
|
|
_1_x = abs(_1_x - 2.0);
|
|
|
|
_1_x = (_1_x * 2.0);
|
|
|
|
_1_x = sign(_1_x);
|
2020-11-24 19:18:23 +00:00
|
|
|
|
|
|
|
float2 _3_x = float2(1.0, 2.0);
|
2020-12-15 20:21:03 +00:00
|
|
|
_3_x = float2(length(float2(1.0, 2.0)));
|
|
|
|
_3_x = float2(distance(_3_x, float2(3.0, 4.0)));
|
|
|
|
_3_x = float2(dot(_3_x, float2(3.0, 4.0)));
|
|
|
|
_3_x = normalize(_3_x);
|
2020-11-24 19:18:23 +00:00
|
|
|
|
2021-02-05 15:07:19 +00:00
|
|
|
_out.sk_FragColor = _uniforms.colorGreen;
|
2021-01-19 18:07:55 +00:00
|
|
|
return _out;
|
2020-11-24 19:18:23 +00:00
|
|
|
}
|