blob: 6c63c38f0cf7f2fd3fe6564af8ab70dfe80d7d89 [file] [log] [blame]
#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 result = 0.0f;
int i = 0;
result = -0.5f;
i = 1;
while (true) {
int const x_144 = i;
if ((x_144 < 800)) {
} else {
break;
}
int const x_147 = i;
if (((x_147 % 32) == 0)) {
float const x_153 = result;
result = (x_153 + 0.400000006f);
} else {
int const x_155 = i;
float const x_157 = *(thirty_two);
if (((float(x_155) - (rint(x_157) * floor((float(x_155) / rint(x_157))))) <= 0.01f)) {
float const x_163 = result;
result = (x_163 + 100.0f);
}
}
int const x_165 = i;
float const x_167 = *(limit);
if ((float(x_165) >= x_167)) {
float const x_171 = result;
return x_171;
}
{
int const x_172 = i;
i = as_type<int>((as_type<uint>(x_172) + as_type<uint>(1)));
}
}
float const x_174 = result;
return x_174;
}
void main_1(constant buf0& x_13, constant buf1& x_19, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) {
float3 c = 0.0f;
float thirty_two_1 = 0.0f;
float param = 0.0f;
float param_1 = 0.0f;
float param_2 = 0.0f;
float param_3 = 0.0f;
float3 x_61 = 0.0f;
int i_1 = 0;
float j = 0.0f;
c = float3(7.0f, 8.0f, 9.0f);
float const x_63 = x_13.resolution.x;
thirty_two_1 = rint((x_63 / 8.0f));
float const x_67 = (*(tint_symbol_3)).x;
param = x_67;
float const x_68 = thirty_two_1;
param_1 = x_68;
float const x_69 = compute_value_f1_f1_(&(param), &(param_1));
c.x = x_69;
float const x_72 = (*(tint_symbol_3)).y;
param_2 = x_72;
float const x_73 = thirty_two_1;
param_3 = x_73;
float const x_74 = compute_value_f1_f1_(&(param_2), &(param_3));
c.y = x_74;
float const x_77 = c.x;
if (true) {
float3 const x_81 = c;
x_61 = x_81;
} else {
float3 const x_82 = c;
float const x_84 = x_19.injectionSwitch.x;
x_61 = (x_82 * x_84);
}
float const x_87 = x_61.y;
c.z = (x_77 + x_87);
i_1 = 0;
while (true) {
int const x_94 = i_1;
if ((x_94 < 3)) {
} else {
break;
}
int const x_97 = i_1;
float const x_99 = c[x_97];
if ((x_99 >= 1.0f)) {
int const x_103 = i_1;
int const x_104 = i_1;
float const x_106 = c[x_104];
int const x_107 = i_1;
float const x_109 = c[x_107];
c[x_103] = (x_106 * x_109);
}
j = 0.0f;
while (true) {
float const x_117 = x_19.injectionSwitch.x;
float const x_119 = x_19.injectionSwitch.y;
if ((x_117 > x_119)) {
} else {
break;
}
float const x_122 = j;
float const x_124 = x_19.injectionSwitch.x;
if ((x_122 >= x_124)) {
break;
}
float const x_128 = j;
j = (x_128 + 1.0f);
}
{
int const x_130 = i_1;
i_1 = as_type<int>((as_type<uint>(x_130) + as_type<uint>(1)));
}
}
float3 const x_132 = c;
float3 const x_134 = normalize(fabs(x_132));
*(tint_symbol_4) = float4(x_134.x, x_134.y, x_134.z, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_13, constant buf1& x_19, 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_13, x_19, 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_13 [[buffer(0)]], constant buf1& x_19 [[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_13, x_19, 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;
}