blob: 5aebe2c22958e1c2a86bea7b663a08f32695fdd5 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
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_91 = 0.0f;
float x_91_phi = 0.0f;
int x_94_phi = 0;
x_91_phi = -0.5f;
x_94_phi = 1;
while (true) {
float x_104 = 0.0f;
float x_113 = 0.0f;
int x_95 = 0;
float x_92_phi = 0.0f;
x_91 = x_91_phi;
int const x_94 = x_94_phi;
if ((x_94 < 800)) {
} else {
break;
}
float x_112 = 0.0f;
float x_113_phi = 0.0f;
if (((x_94 % 32) == 0)) {
x_104 = (x_91 + 0.400000006f);
x_92_phi = x_104;
} else {
float const x_106 = *(thirty_two);
x_113_phi = x_91;
if ((fmod(float(x_94), rint(x_106)) <= 0.01f)) {
x_112 = (x_91 + 100.0f);
x_113_phi = x_112;
}
x_113 = x_113_phi;
x_92_phi = x_113;
}
float x_92 = 0.0f;
x_92 = x_92_phi;
float const x_115 = *(limit);
if ((float(x_94) >= x_115)) {
return x_92;
}
{
x_95 = as_type<int>((as_type<uint>(x_94) + as_type<uint>(1)));
x_91_phi = x_92;
x_94_phi = x_95;
}
}
return x_91;
}
void main_1(constant buf0& x_10, 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;
int x_68_phi = 0;
c = float3(7.0f, 8.0f, 9.0f);
float const x_52 = x_10.resolution.x;
float const x_54 = rint((x_52 * 0.125f));
float const x_56 = (*(tint_symbol_3)).x;
param = x_56;
param_1 = x_54;
float const x_57 = compute_value_f1_f1_(&(param), &(param_1));
c.x = x_57;
float const x_60 = (*(tint_symbol_3)).y;
param_2 = x_60;
param_3 = x_54;
float const x_61 = compute_value_f1_f1_(&(param_2), &(param_3));
c.y = x_61;
float const x_63 = c.x;
float const x_64 = c.y;
c.z = (x_63 + x_64);
x_68_phi = 0;
while (true) {
int x_69 = 0;
int const x_68 = x_68_phi;
if ((x_68 < 3)) {
} else {
break;
}
int const x_74_save = x_68;
float const x_75 = c[x_74_save];
if ((x_75 >= 1.0f)) {
float const x_79 = c[x_74_save];
float const x_80 = c[x_74_save];
c[x_74_save] = (x_79 * x_80);
}
{
x_69 = as_type<int>((as_type<uint>(x_68) + as_type<uint>(1)));
x_68_phi = x_69;
}
}
float3 const x_82 = c;
float3 const x_84 = normalize(fabs(x_82));
*(tint_symbol_4) = float4(x_84.x, x_84.y, x_84.z, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_10, 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, 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)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_10, 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;
}