Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / tests / sksl / shared / ReturnsValueOnEveryPathES2.metal
1 #include <metal_stdlib>
2 #include <simd/simd.h>
3 using namespace metal;
4 struct Uniforms {
5     half4 colorGreen;
6     half4 colorRed;
7     half unknownInput;
8 };
9 struct Inputs {
10 };
11 struct Outputs {
12     half4 sk_FragColor [[color(0)]];
13 };
14 bool return_on_both_sides_b(Uniforms _uniforms) {
15     if (_uniforms.unknownInput == 1.0h) return true; else return true;
16 }
17 bool for_inside_body_b() {
18     for (int x = 0;x <= 10; ++x) {
19         return true;
20     }
21 }
22 bool after_for_body_b() {
23     for (int x = 0;x <= 10; ++x) {
24     }
25     return true;
26 }
27 bool for_with_double_sided_conditional_return_b(Uniforms _uniforms) {
28     for (int x = 0;x <= 10; ++x) {
29         if (_uniforms.unknownInput == 1.0h) return true; else return true;
30     }
31 }
32 bool if_else_chain_b(Uniforms _uniforms) {
33     if (_uniforms.unknownInput == 1.0h) return true; else if (_uniforms.unknownInput == 2.0h) return false; else if (_uniforms.unknownInput == 3.0h) return true; else if (_uniforms.unknownInput == 4.0h) return false; else return true;
34 }
35 fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
36     Outputs _out;
37     (void)_out;
38     _out.sk_FragColor = ((((true && return_on_both_sides_b(_uniforms)) && for_inside_body_b()) && after_for_body_b()) && for_with_double_sided_conditional_return_b(_uniforms)) && if_else_chain_b(_uniforms) ? _uniforms.colorGreen : _uniforms.colorRed;
39     return _out;
40 }