blob: 70aae8876033a7a2257a49ac9c1e21c1b775cd45 [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_2 {
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_125 = i;
if ((x_125 < 800)) {
} else {
break;
}
int const x_128 = i;
if (((x_128 % 32) == 0)) {
float const x_134 = result;
result = (x_134 + 0.400000006f);
} else {
int const x_136 = i;
float const x_138 = *(thirty_two);
if ((fmod(float(x_136), rint(x_138)) <= 0.01f)) {
float const x_144 = result;
result = (x_144 + 100.0f);
}
}
int const x_146 = i;
float const x_148 = *(limit);
if ((float(x_146) >= x_148)) {
float const x_152 = result;
return x_152;
}
{
int const x_153 = i;
i = as_type<int>((as_type<uint>(x_153) + as_type<uint>(1)));
}
}
float const x_155 = result;
return x_155;
}
void main_1(constant buf0& x_13, constant buf1& x_20, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
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;
int i_1 = 0;
float3 x_58 = 0.0f;
c = float3(7.0f, 8.0f, 9.0f);
float const x_60 = x_13.resolution.x;
thirty_two_1 = rint((x_60 / 8.0f));
float const x_64 = (*(tint_symbol_5)).x;
param = x_64;
float const x_65 = thirty_two_1;
param_1 = x_65;
float const x_66 = compute_value_f1_f1_(&(param), &(param_1));
c.x = x_66;
float const x_69 = (*(tint_symbol_5)).y;
param_2 = x_69;
float const x_70 = thirty_two_1;
param_3 = x_70;
float const x_71 = compute_value_f1_f1_(&(param_2), &(param_3));
c.y = x_71;
float const x_74 = c.x;
float const x_76 = c.y;
c.z = (x_74 + x_76);
i_1 = 0;
while (true) {
int const x_83 = i_1;
if ((x_83 < 3)) {
} else {
break;
}
int const x_86 = i_1;
float const x_88 = c[x_86];
if ((x_88 >= 1.0f)) {
int const x_92 = i_1;
int const x_93 = i_1;
float const x_95 = c[x_93];
int const x_96 = i_1;
float const x_98 = c[x_96];
c[x_92] = (x_95 * x_98);
}
{
int const x_101 = i_1;
i_1 = as_type<int>((as_type<uint>(x_101) + as_type<uint>(1)));
}
}
float const x_104 = x_20.injectionSwitch.x;
float const x_106 = x_20.injectionSwitch.y;
if ((x_104 < x_106)) {
float3 const x_111 = c;
x_58 = fabs(x_111);
} else {
float3 const x_113 = c;
x_58 = x_113;
}
float3 const x_114 = x_58;
float3 const x_115 = normalize(x_114);
*(tint_symbol_6) = float4(x_115.x, x_115.y, x_115.z, 1.0f);
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_13 [[buffer(0)]], constant buf1& x_20 [[buffer(1)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
tint_symbol_7 = gl_FragCoord_param;
main_1(x_13, x_20, &(tint_symbol_7), &(tint_symbol_8));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_8};
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_4;
}