| #include <metal_stdlib> |
| |
| using namespace metal; |
| struct buf0 { |
| /* 0x0000 */ packed_float2 resolution; |
| }; |
| struct buf1 { |
| /* 0x0000 */ packed_float2 injectionSwitch; |
| }; |
| struct main_out { |
| float4 x_GLF_color_1; |
| }; |
| struct tint_symbol_1 { |
| float4 x_GLF_color_1 [[color(0)]]; |
| }; |
| |
| float compute_value_f1_f1_(thread float* const limit, thread float* const thirty_two) { |
| float x_104 = 0.0f; |
| float x_104_phi = 0.0f; |
| int x_107_phi = 0; |
| x_104_phi = -0.5f; |
| x_107_phi = 1; |
| while (true) { |
| float x_126 = 0.0f; |
| float x_125 = 0.0f; |
| int x_108 = 0; |
| float x_105_phi = 0.0f; |
| x_104 = x_104_phi; |
| int const x_107 = x_107_phi; |
| if ((x_107 < 800)) { |
| } else { |
| break; |
| } |
| float x_124 = 0.0f; |
| float x_125_phi = 0.0f; |
| if (((x_107 % 32) == 0)) { |
| x_126 = (x_104 + 0.400000006f); |
| x_105_phi = x_126; |
| } else { |
| float const x_118 = *(thirty_two); |
| x_125_phi = x_104; |
| if (((float(x_107) - (rint(x_118) * floor((float(x_107) / rint(x_118))))) <= 0.01f)) { |
| x_124 = (x_104 + 100.0f); |
| x_125_phi = x_124; |
| } |
| x_125 = x_125_phi; |
| x_105_phi = x_125; |
| } |
| float x_105 = 0.0f; |
| x_105 = x_105_phi; |
| float const x_128 = *(limit); |
| if ((float(x_107) >= x_128)) { |
| return x_105; |
| } |
| { |
| x_108 = as_type<int>((as_type<uint>(x_107) + as_type<uint>(1))); |
| x_104_phi = x_105; |
| x_107_phi = x_108; |
| } |
| } |
| return x_104; |
| } |
| |
| void main_1(constant buf0& x_10, constant buf1& x_16, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) { |
| float3 c = 0.0f; |
| float param = 0.0f; |
| float param_1 = 0.0f; |
| float param_2 = 0.0f; |
| float param_3 = 0.0f; |
| float3 x_54 = 0.0f; |
| int x_74_phi = 0; |
| c = float3(7.0f, 8.0f, 9.0f); |
| float const x_56 = x_10.resolution.x; |
| float const x_58 = rint((x_56 * 0.125f)); |
| float const x_60 = (*(tint_symbol_3)).x; |
| param = x_60; |
| param_1 = x_58; |
| float const x_61 = compute_value_f1_f1_(&(param), &(param_1)); |
| c.x = x_61; |
| float const x_64 = (*(tint_symbol_3)).y; |
| param_2 = x_64; |
| param_3 = x_58; |
| float const x_65 = compute_value_f1_f1_(&(param_2), &(param_3)); |
| c.y = x_65; |
| float const x_67 = c.x; |
| float3 const x_68 = c; |
| x_54 = x_68; |
| float const x_70 = x_54.y; |
| c.z = (x_67 + x_70); |
| x_74_phi = 0; |
| while (true) { |
| int x_75 = 0; |
| int const x_74 = x_74_phi; |
| if ((x_74 < 3)) { |
| } else { |
| break; |
| } |
| int const x_80_save = x_74; |
| float const x_81 = c[x_80_save]; |
| if ((x_81 >= 1.0f)) { |
| float const x_86 = x_16.injectionSwitch.x; |
| float const x_88 = x_16.injectionSwitch.y; |
| if ((x_86 > x_88)) { |
| discard_fragment(); |
| } |
| float const x_92 = c[x_80_save]; |
| float const x_93 = c[x_80_save]; |
| c[x_80_save] = (x_92 * x_93); |
| } |
| { |
| x_75 = as_type<int>((as_type<uint>(x_74) + as_type<uint>(1))); |
| x_74_phi = x_75; |
| } |
| } |
| float3 const x_95 = c; |
| float3 const x_97 = normalize(fabs(x_95)); |
| *(tint_symbol_4) = float4(x_97.x, x_97.y, x_97.z, 1.0f); |
| return; |
| } |
| |
| main_out tint_symbol_inner(constant buf0& x_10, constant buf1& x_16, float4 gl_FragCoord_param, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) { |
| *(tint_symbol_5) = gl_FragCoord_param; |
| main_1(x_10, x_16, tint_symbol_5, tint_symbol_6); |
| main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)}; |
| return tint_symbol_2; |
| } |
| |
| fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_10 [[buffer(0)]], constant buf1& x_16 [[buffer(1)]]) { |
| thread float4 tint_symbol_7 = 0.0f; |
| thread float4 tint_symbol_8 = 0.0f; |
| main_out const inner_result = tint_symbol_inner(x_10, x_16, gl_FragCoord_param, &(tint_symbol_7), &(tint_symbol_8)); |
| tint_symbol_1 wrapper_result = {}; |
| wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; |
| return wrapper_result; |
| } |
| |