• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3using namespace metal;
4struct Uniforms {
5    half4 inputA;
6    half4 inputB;
7    half4 colorGreen;
8    half4 colorRed;
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 expected = half4(5.0h, 17.0h, 38.0h, 70.0h);
19    _out.sk_FragColor = (((((((_uniforms.inputA.x * _uniforms.inputB.x) == expected.x && dot(_uniforms.inputA.xy, _uniforms.inputB.xy) == expected.y) && dot(_uniforms.inputA.xyz, _uniforms.inputB.xyz) == expected.z) && dot(_uniforms.inputA, _uniforms.inputB) == expected.w) && 5.0h == expected.x) && 17.0h == expected.y) && 38.0h == expected.z) && 70.0h == expected.w ? _uniforms.colorGreen : _uniforms.colorRed;
20    return _out;
21}
22