1#include <metal_stdlib> 2#include <simd/simd.h> 3using namespace metal; 4struct Uniforms { 5 half4 colorGreen; 6 half4 colorRed; 7 half4 colorWhite; 8}; 9struct Inputs { 10}; 11struct Outputs { 12 half4 sk_FragColor [[color(0)]]; 13}; 14void out_half_vh(Uniforms _uniforms, thread half& v); 15void _skOutParamHelper0_out_half_vh(Uniforms _uniforms, thread half& h) { 16 half _var0; 17 out_half_vh(_uniforms, _var0); 18 h = _var0; 19} 20void out_half2_vh2(Uniforms _uniforms, thread half2& v); 21void _skOutParamHelper1_out_half2_vh2(Uniforms _uniforms, thread half2& h2) { 22 half2 _var0; 23 out_half2_vh2(_uniforms, _var0); 24 h2 = _var0; 25} 26void out_half3_vh3(Uniforms _uniforms, thread half3& v); 27void _skOutParamHelper2_out_half3_vh3(Uniforms _uniforms, thread half3& h3) { 28 half3 _var0; 29 out_half3_vh3(_uniforms, _var0); 30 h3 = _var0; 31} 32void out_half4_vh4(Uniforms _uniforms, thread half4& v); 33void _skOutParamHelper3_out_half4_vh4(Uniforms _uniforms, thread half4& h4) { 34 half4 _var0; 35 out_half4_vh4(_uniforms, _var0); 36 h4 = _var0; 37} 38void out_half_vh(Uniforms _uniforms, thread half& v); 39void _skOutParamHelper4_out_half_vh(Uniforms _uniforms, thread half3& h3) { 40 half _var0; 41 out_half_vh(_uniforms, _var0); 42 h3.y = _var0; 43} 44void out_half2_vh2(Uniforms _uniforms, thread half2& v); 45void _skOutParamHelper5_out_half2_vh2(Uniforms _uniforms, thread half3& h3) { 46 half2 _var0; 47 out_half2_vh2(_uniforms, _var0); 48 h3.xz = _var0; 49} 50void out_half4_vh4(Uniforms _uniforms, thread half4& v); 51void _skOutParamHelper6_out_half4_vh4(Uniforms _uniforms, thread half4& h4) { 52 half4 _var0; 53 out_half4_vh4(_uniforms, _var0); 54 h4.zwxy = _var0; 55} 56void out_half2x2_vh22(Uniforms _uniforms, thread half2x2& v); 57void _skOutParamHelper7_out_half2x2_vh22(Uniforms _uniforms, thread half2x2& h2x2) { 58 half2x2 _var0; 59 out_half2x2_vh22(_uniforms, _var0); 60 h2x2 = _var0; 61} 62void out_half3x3_vh33(Uniforms _uniforms, thread half3x3& v); 63void _skOutParamHelper8_out_half3x3_vh33(Uniforms _uniforms, thread half3x3& h3x3) { 64 half3x3 _var0; 65 out_half3x3_vh33(_uniforms, _var0); 66 h3x3 = _var0; 67} 68void out_half4x4_vh44(Uniforms _uniforms, thread half4x4& v); 69void _skOutParamHelper9_out_half4x4_vh44(Uniforms _uniforms, thread half4x4& h4x4) { 70 half4x4 _var0; 71 out_half4x4_vh44(_uniforms, _var0); 72 h4x4 = _var0; 73} 74void out_half3_vh3(Uniforms _uniforms, thread half3& v); 75void _skOutParamHelper10_out_half3_vh3(Uniforms _uniforms, thread half3x3& h3x3) { 76 half3 _var0; 77 out_half3_vh3(_uniforms, _var0); 78 h3x3[1] = _var0; 79} 80void out_half_vh(Uniforms _uniforms, thread half& v); 81void _skOutParamHelper11_out_half_vh(Uniforms _uniforms, thread half4x4& h4x4) { 82 half _var0; 83 out_half_vh(_uniforms, _var0); 84 h4x4[3].w = _var0; 85} 86void out_half_vh(Uniforms _uniforms, thread half& v); 87void _skOutParamHelper12_out_half_vh(Uniforms _uniforms, thread half2x2& h2x2) { 88 half _var0; 89 out_half_vh(_uniforms, _var0); 90 h2x2[0].x = _var0; 91} 92void out_int_vi(Uniforms _uniforms, thread int& v); 93void _skOutParamHelper13_out_int_vi(Uniforms _uniforms, thread int& i) { 94 int _var0; 95 out_int_vi(_uniforms, _var0); 96 i = _var0; 97} 98void out_int2_vi2(Uniforms _uniforms, thread int2& v); 99void _skOutParamHelper14_out_int2_vi2(Uniforms _uniforms, thread int2& i2) { 100 int2 _var0; 101 out_int2_vi2(_uniforms, _var0); 102 i2 = _var0; 103} 104void out_int3_vi3(Uniforms _uniforms, thread int3& v); 105void _skOutParamHelper15_out_int3_vi3(Uniforms _uniforms, thread int3& i3) { 106 int3 _var0; 107 out_int3_vi3(_uniforms, _var0); 108 i3 = _var0; 109} 110void out_int4_vi4(Uniforms _uniforms, thread int4& v); 111void _skOutParamHelper16_out_int4_vi4(Uniforms _uniforms, thread int4& i4) { 112 int4 _var0; 113 out_int4_vi4(_uniforms, _var0); 114 i4 = _var0; 115} 116void out_int3_vi3(Uniforms _uniforms, thread int3& v); 117void _skOutParamHelper17_out_int3_vi3(Uniforms _uniforms, thread int4& i4) { 118 int3 _var0; 119 out_int3_vi3(_uniforms, _var0); 120 i4.xyz = _var0; 121} 122void out_int_vi(Uniforms _uniforms, thread int& v); 123void _skOutParamHelper18_out_int_vi(Uniforms _uniforms, thread int2& i2) { 124 int _var0; 125 out_int_vi(_uniforms, _var0); 126 i2.y = _var0; 127} 128void out_float_vf(Uniforms _uniforms, thread float& v); 129void _skOutParamHelper19_out_float_vf(Uniforms _uniforms, thread float& f) { 130 float _var0; 131 out_float_vf(_uniforms, _var0); 132 f = _var0; 133} 134void out_float2_vf2(Uniforms _uniforms, thread float2& v); 135void _skOutParamHelper20_out_float2_vf2(Uniforms _uniforms, thread float2& f2) { 136 float2 _var0; 137 out_float2_vf2(_uniforms, _var0); 138 f2 = _var0; 139} 140void out_float3_vf3(Uniforms _uniforms, thread float3& v); 141void _skOutParamHelper21_out_float3_vf3(Uniforms _uniforms, thread float3& f3) { 142 float3 _var0; 143 out_float3_vf3(_uniforms, _var0); 144 f3 = _var0; 145} 146void out_float4_vf4(Uniforms _uniforms, thread float4& v); 147void _skOutParamHelper22_out_float4_vf4(Uniforms _uniforms, thread float4& f4) { 148 float4 _var0; 149 out_float4_vf4(_uniforms, _var0); 150 f4 = _var0; 151} 152void out_float2_vf2(Uniforms _uniforms, thread float2& v); 153void _skOutParamHelper23_out_float2_vf2(Uniforms _uniforms, thread float3& f3) { 154 float2 _var0; 155 out_float2_vf2(_uniforms, _var0); 156 f3.xy = _var0; 157} 158void out_float_vf(Uniforms _uniforms, thread float& v); 159void _skOutParamHelper24_out_float_vf(Uniforms _uniforms, thread float2& f2) { 160 float _var0; 161 out_float_vf(_uniforms, _var0); 162 f2.x = _var0; 163} 164void out_float2x2_vf22(Uniforms _uniforms, thread float2x2& v); 165void _skOutParamHelper25_out_float2x2_vf22(Uniforms _uniforms, thread float2x2& f2x2) { 166 float2x2 _var0; 167 out_float2x2_vf22(_uniforms, _var0); 168 f2x2 = _var0; 169} 170void out_float3x3_vf33(Uniforms _uniforms, thread float3x3& v); 171void _skOutParamHelper26_out_float3x3_vf33(Uniforms _uniforms, thread float3x3& f3x3) { 172 float3x3 _var0; 173 out_float3x3_vf33(_uniforms, _var0); 174 f3x3 = _var0; 175} 176void out_float4x4_vf44(Uniforms _uniforms, thread float4x4& v); 177void _skOutParamHelper27_out_float4x4_vf44(Uniforms _uniforms, thread float4x4& f4x4) { 178 float4x4 _var0; 179 out_float4x4_vf44(_uniforms, _var0); 180 f4x4 = _var0; 181} 182void out_float_vf(Uniforms _uniforms, thread float& v); 183void _skOutParamHelper28_out_float_vf(Uniforms _uniforms, thread float2x2& f2x2) { 184 float _var0; 185 out_float_vf(_uniforms, _var0); 186 f2x2[0].x = _var0; 187} 188void out_bool_vb(Uniforms _uniforms, thread bool& v); 189void _skOutParamHelper29_out_bool_vb(Uniforms _uniforms, thread bool& b) { 190 bool _var0; 191 out_bool_vb(_uniforms, _var0); 192 b = _var0; 193} 194void out_bool2_vb2(Uniforms _uniforms, thread bool2& v); 195void _skOutParamHelper30_out_bool2_vb2(Uniforms _uniforms, thread bool2& b2) { 196 bool2 _var0; 197 out_bool2_vb2(_uniforms, _var0); 198 b2 = _var0; 199} 200void out_bool3_vb3(Uniforms _uniforms, thread bool3& v); 201void _skOutParamHelper31_out_bool3_vb3(Uniforms _uniforms, thread bool3& b3) { 202 bool3 _var0; 203 out_bool3_vb3(_uniforms, _var0); 204 b3 = _var0; 205} 206void out_bool4_vb4(Uniforms _uniforms, thread bool4& v); 207void _skOutParamHelper32_out_bool4_vb4(Uniforms _uniforms, thread bool4& b4) { 208 bool4 _var0; 209 out_bool4_vb4(_uniforms, _var0); 210 b4 = _var0; 211} 212void out_bool2_vb2(Uniforms _uniforms, thread bool2& v); 213void _skOutParamHelper33_out_bool2_vb2(Uniforms _uniforms, thread bool4& b4) { 214 bool2 _var0; 215 out_bool2_vb2(_uniforms, _var0); 216 b4.xw = _var0; 217} 218void out_bool_vb(Uniforms _uniforms, thread bool& v); 219void _skOutParamHelper34_out_bool_vb(Uniforms _uniforms, thread bool3& b3) { 220 bool _var0; 221 out_bool_vb(_uniforms, _var0); 222 b3.z = _var0; 223} 224void out_half_vh(Uniforms _uniforms, thread half& v) { 225 v = _uniforms.colorWhite.x; 226} 227void out_half2_vh2(Uniforms _uniforms, thread half2& v) { 228 v = half2(_uniforms.colorWhite.y); 229} 230void out_half3_vh3(Uniforms _uniforms, thread half3& v) { 231 v = half3(_uniforms.colorWhite.z); 232} 233void out_half4_vh4(Uniforms _uniforms, thread half4& v) { 234 v = half4(_uniforms.colorWhite.w); 235} 236void out_half2x2_vh22(Uniforms _uniforms, thread half2x2& v) { 237 v = half2x2(_uniforms.colorWhite.x); 238} 239void out_half3x3_vh33(Uniforms _uniforms, thread half3x3& v) { 240 v = half3x3(_uniforms.colorWhite.y); 241} 242void out_half4x4_vh44(Uniforms _uniforms, thread half4x4& v) { 243 v = half4x4(_uniforms.colorWhite.z); 244} 245void out_int_vi(Uniforms _uniforms, thread int& v) { 246 v = int(_uniforms.colorWhite.x); 247} 248void out_int2_vi2(Uniforms _uniforms, thread int2& v) { 249 v = int2(int(_uniforms.colorWhite.y)); 250} 251void out_int3_vi3(Uniforms _uniforms, thread int3& v) { 252 v = int3(int(_uniforms.colorWhite.z)); 253} 254void out_int4_vi4(Uniforms _uniforms, thread int4& v) { 255 v = int4(int(_uniforms.colorWhite.w)); 256} 257void out_float_vf(Uniforms _uniforms, thread float& v) { 258 v = float(_uniforms.colorWhite.x); 259} 260void out_float2_vf2(Uniforms _uniforms, thread float2& v) { 261 v = float2(float(_uniforms.colorWhite.y)); 262} 263void out_float3_vf3(Uniforms _uniforms, thread float3& v) { 264 v = float3(float(_uniforms.colorWhite.z)); 265} 266void out_float4_vf4(Uniforms _uniforms, thread float4& v) { 267 v = float4(float(_uniforms.colorWhite.w)); 268} 269void out_float2x2_vf22(Uniforms _uniforms, thread float2x2& v) { 270 v = float2x2(float(_uniforms.colorWhite.x)); 271} 272void out_float3x3_vf33(Uniforms _uniforms, thread float3x3& v) { 273 v = float3x3(float(_uniforms.colorWhite.y)); 274} 275void out_float4x4_vf44(Uniforms _uniforms, thread float4x4& v) { 276 v = float4x4(float(_uniforms.colorWhite.z)); 277} 278void out_bool_vb(Uniforms _uniforms, thread bool& v) { 279 v = bool(_uniforms.colorWhite.x); 280} 281void out_bool2_vb2(Uniforms _uniforms, thread bool2& v) { 282 v = bool2(bool(_uniforms.colorWhite.y)); 283} 284void out_bool3_vb3(Uniforms _uniforms, thread bool3& v) { 285 v = bool3(bool(_uniforms.colorWhite.z)); 286} 287void out_bool4_vb4(Uniforms _uniforms, thread bool4& v) { 288 v = bool4(bool(_uniforms.colorWhite.w)); 289} 290fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 291 Outputs _out; 292 (void)_out; 293 half h; 294 _skOutParamHelper0_out_half_vh(_uniforms, h); 295 half2 h2; 296 _skOutParamHelper1_out_half2_vh2(_uniforms, h2); 297 half3 h3; 298 _skOutParamHelper2_out_half3_vh3(_uniforms, h3); 299 half4 h4; 300 _skOutParamHelper3_out_half4_vh4(_uniforms, h4); 301 _skOutParamHelper4_out_half_vh(_uniforms, h3); 302 _skOutParamHelper5_out_half2_vh2(_uniforms, h3); 303 _skOutParamHelper6_out_half4_vh4(_uniforms, h4); 304 half2x2 h2x2; 305 _skOutParamHelper7_out_half2x2_vh22(_uniforms, h2x2); 306 half3x3 h3x3; 307 _skOutParamHelper8_out_half3x3_vh33(_uniforms, h3x3); 308 half4x4 h4x4; 309 _skOutParamHelper9_out_half4x4_vh44(_uniforms, h4x4); 310 _skOutParamHelper10_out_half3_vh3(_uniforms, h3x3); 311 _skOutParamHelper11_out_half_vh(_uniforms, h4x4); 312 _skOutParamHelper12_out_half_vh(_uniforms, h2x2); 313 int i; 314 _skOutParamHelper13_out_int_vi(_uniforms, i); 315 int2 i2; 316 _skOutParamHelper14_out_int2_vi2(_uniforms, i2); 317 int3 i3; 318 _skOutParamHelper15_out_int3_vi3(_uniforms, i3); 319 int4 i4; 320 _skOutParamHelper16_out_int4_vi4(_uniforms, i4); 321 _skOutParamHelper17_out_int3_vi3(_uniforms, i4); 322 _skOutParamHelper18_out_int_vi(_uniforms, i2); 323 float f; 324 _skOutParamHelper19_out_float_vf(_uniforms, f); 325 float2 f2; 326 _skOutParamHelper20_out_float2_vf2(_uniforms, f2); 327 float3 f3; 328 _skOutParamHelper21_out_float3_vf3(_uniforms, f3); 329 float4 f4; 330 _skOutParamHelper22_out_float4_vf4(_uniforms, f4); 331 _skOutParamHelper23_out_float2_vf2(_uniforms, f3); 332 _skOutParamHelper24_out_float_vf(_uniforms, f2); 333 float2x2 f2x2; 334 _skOutParamHelper25_out_float2x2_vf22(_uniforms, f2x2); 335 float3x3 f3x3; 336 _skOutParamHelper26_out_float3x3_vf33(_uniforms, f3x3); 337 float4x4 f4x4; 338 _skOutParamHelper27_out_float4x4_vf44(_uniforms, f4x4); 339 _skOutParamHelper28_out_float_vf(_uniforms, f2x2); 340 bool b; 341 _skOutParamHelper29_out_bool_vb(_uniforms, b); 342 bool2 b2; 343 _skOutParamHelper30_out_bool2_vb2(_uniforms, b2); 344 bool3 b3; 345 _skOutParamHelper31_out_bool3_vb3(_uniforms, b3); 346 bool4 b4; 347 _skOutParamHelper32_out_bool4_vb4(_uniforms, b4); 348 _skOutParamHelper33_out_bool2_vb2(_uniforms, b4); 349 _skOutParamHelper34_out_bool_vb(_uniforms, b3); 350 bool ok = true; 351 ok = ok && 1.0h == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x; 352 ok = ok && 1.0 == (((((f * f2.x) * f3.x) * f4.x) * f2x2[0].x) * f3x3[0].x) * f4x4[0].x; 353 ok = ok && 1 == ((i * i2.x) * i3.x) * i4.x; 354 ok = ok && (((b && b2.x) && b3.x) && b4.x); 355 _out.sk_FragColor = ok ? _uniforms.colorGreen : _uniforms.colorRed; 356 return _out; 357} 358