1*c8dee2aaSAndroid Build Coastguard Worker#include <metal_stdlib> 2*c8dee2aaSAndroid Build Coastguard Worker#include <simd/simd.h> 3*c8dee2aaSAndroid Build Coastguard Worker#ifdef __clang__ 4*c8dee2aaSAndroid Build Coastguard Worker#pragma clang diagnostic ignored "-Wall" 5*c8dee2aaSAndroid Build Coastguard Worker#endif 6*c8dee2aaSAndroid Build Coastguard Workerusing namespace metal; 7*c8dee2aaSAndroid Build Coastguard Workerstruct Uniforms { 8*c8dee2aaSAndroid Build Coastguard Worker half4 testInputs; 9*c8dee2aaSAndroid Build Coastguard Worker half4 colorGreen; 10*c8dee2aaSAndroid Build Coastguard Worker half4 colorRed; 11*c8dee2aaSAndroid Build Coastguard Worker}; 12*c8dee2aaSAndroid Build Coastguard Workerstruct Inputs { 13*c8dee2aaSAndroid Build Coastguard Worker}; 14*c8dee2aaSAndroid Build Coastguard Workerstruct Outputs { 15*c8dee2aaSAndroid Build Coastguard Worker half4 sk_FragColor [[color(0)]]; 16*c8dee2aaSAndroid Build Coastguard Worker}; 17*c8dee2aaSAndroid Build Coastguard Workerfragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 18*c8dee2aaSAndroid Build Coastguard Worker Outputs _out; 19*c8dee2aaSAndroid Build Coastguard Worker (void)_out; 20*c8dee2aaSAndroid Build Coastguard Worker half4 _0_v = _uniforms.testInputs; 21*c8dee2aaSAndroid Build Coastguard Worker half _1_x = _0_v.x; 22*c8dee2aaSAndroid Build Coastguard Worker half _2_y = _0_v.y; 23*c8dee2aaSAndroid Build Coastguard Worker half _3_z = _0_v.z; 24*c8dee2aaSAndroid Build Coastguard Worker half _4_w = _0_v.w; 25*c8dee2aaSAndroid Build Coastguard Worker half4 a = half4(_1_x, _2_y, _3_z, _4_w); 26*c8dee2aaSAndroid Build Coastguard Worker half _9_x = _uniforms.testInputs.x; 27*c8dee2aaSAndroid Build Coastguard Worker half _10_y = _uniforms.testInputs.y; 28*c8dee2aaSAndroid Build Coastguard Worker half _11_z = _uniforms.testInputs.z; 29*c8dee2aaSAndroid Build Coastguard Worker half _12_w = _uniforms.testInputs.w; 30*c8dee2aaSAndroid Build Coastguard Worker half4 b = half4(_9_x, _10_y, _11_z, _12_w); 31*c8dee2aaSAndroid Build Coastguard Worker half4 c = half4(0.0h, 1.0h, 2.0h, 3.0h); 32*c8dee2aaSAndroid Build Coastguard Worker _out.sk_FragColor = (all(a == half4(-1.25h, 0.0h, 0.75h, 2.25h)) && all(b == half4(-1.25h, 0.0h, 0.75h, 2.25h))) && all(c == half4(0.0h, 1.0h, 2.0h, 3.0h)) ? _uniforms.colorGreen : _uniforms.colorRed; 33*c8dee2aaSAndroid Build Coastguard Worker return _out; 34*c8dee2aaSAndroid Build Coastguard Worker} 35