Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / tests / sksl / intrinsics / CrossNoInline.metal
1 #include <metal_stdlib>
2 #include <simd/simd.h>
3 using namespace metal;
4 struct Uniforms {
5     half2 ah;
6     half2 bh;
7     float2 af;
8     float2 bf;
9 };
10 struct Inputs {
11 };
12 struct Outputs {
13     half4 sk_FragColor [[color(0)]];
14 };
15 half cross_length_2d_hh2h2(half2 a, half2 b) {
16     return a.x * b.y - a.y * b.x;
17 }
18 float cross_length_2d_ff2f2(float2 a, float2 b) {
19     return a.x * b.y - a.y * b.x;
20 }
21 fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
22     Outputs _out;
23     (void)_out;
24     _out.sk_FragColor.x = cross_length_2d_hh2h2(_uniforms.ah, _uniforms.bh);
25     _out.sk_FragColor.y = half(cross_length_2d_ff2f2(_uniforms.af, _uniforms.bf));
26     return _out;
27 }