blob: a7377e3750bb222a9691737ddba38273b3f494fd [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf1 {
/* 0x0000 */ packed_float2 injectionSwitch;
};
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
float3 c = 0.0f;
float x_54 = 0.0f;
float x_58 = 0.0f;
float x_59 = 0.0f;
float x_91 = 0.0f;
float x_92 = 0.0f;
float x_135 = 0.0f;
float x_136 = 0.0f;
float x_58_phi = 0.0f;
int x_61_phi = 0;
float x_91_phi = 0.0f;
float x_92_phi = 0.0f;
bool x_93_phi = false;
float x_95_phi = 0.0f;
float x_139_phi = 0.0f;
int x_146_phi = 0;
c = float3(7.0f, 8.0f, 9.0f);
float const x_50 = x_9.resolution.x;
float const x_52 = rint((x_50 * 0.125f));
x_54 = (*(tint_symbol_5)).x;
switch(0u) {
default: {
x_58_phi = -0.5f;
x_61_phi = 1;
while (true) {
float x_71 = 0.0f;
float x_79 = 0.0f;
int x_62 = 0;
float x_59_phi = 0.0f;
x_58 = x_58_phi;
int const x_61 = x_61_phi;
x_91_phi = 0.0f;
x_92_phi = x_58;
x_93_phi = false;
if ((x_61 < 800)) {
} else {
break;
}
float x_78 = 0.0f;
float x_79_phi = 0.0f;
if (((x_61 % 32) == 0)) {
x_71 = (x_58 + 0.400000006f);
x_59_phi = x_71;
} else {
x_79_phi = x_58;
if (((float(x_61) - (rint(x_52) * floor((float(x_61) / rint(x_52))))) <= 0.01f)) {
x_78 = (x_58 + 100.0f);
x_79_phi = x_78;
}
x_79 = x_79_phi;
float const x_81 = x_6.injectionSwitch.x;
float const x_83 = x_6.injectionSwitch.y;
if ((x_81 > x_83)) {
discard_fragment();
}
x_59_phi = x_79;
}
x_59 = x_59_phi;
if ((float(x_61) >= x_54)) {
x_91_phi = x_59;
x_92_phi = x_59;
x_93_phi = true;
break;
}
{
x_62 = as_type<int>((as_type<uint>(x_61) + as_type<uint>(1)));
x_58_phi = x_59;
x_61_phi = x_62;
}
}
x_91 = x_91_phi;
x_92 = x_92_phi;
bool const x_93 = x_93_phi;
x_95_phi = x_91;
if (x_93) {
break;
}
x_95_phi = x_92;
break;
}
}
float x_98 = 0.0f;
float x_102 = 0.0f;
float x_103 = 0.0f;
float x_102_phi = 0.0f;
int x_105_phi = 0;
float x_135_phi = 0.0f;
float x_136_phi = 0.0f;
bool x_137_phi = false;
float const x_95 = x_95_phi;
c.x = x_95;
x_98 = (*(tint_symbol_5)).y;
switch(0u) {
default: {
x_102_phi = -0.5f;
x_105_phi = 1;
while (true) {
float x_115 = 0.0f;
float x_123 = 0.0f;
int x_106 = 0;
float x_103_phi = 0.0f;
x_102 = x_102_phi;
int const x_105 = x_105_phi;
x_135_phi = 0.0f;
x_136_phi = x_102;
x_137_phi = false;
if ((x_105 < 800)) {
} else {
break;
}
float x_122 = 0.0f;
float x_123_phi = 0.0f;
if (((x_105 % 32) == 0)) {
x_115 = (x_102 + 0.400000006f);
x_103_phi = x_115;
} else {
x_123_phi = x_102;
if (((float(x_105) - (rint(x_52) * floor((float(x_105) / rint(x_52))))) <= 0.01f)) {
x_122 = (x_102 + 100.0f);
x_123_phi = x_122;
}
x_123 = x_123_phi;
float const x_125 = x_6.injectionSwitch.x;
float const x_127 = x_6.injectionSwitch.y;
if ((x_125 > x_127)) {
discard_fragment();
}
x_103_phi = x_123;
}
x_103 = x_103_phi;
if ((float(x_105) >= x_98)) {
x_135_phi = x_103;
x_136_phi = x_103;
x_137_phi = true;
break;
}
{
x_106 = as_type<int>((as_type<uint>(x_105) + as_type<uint>(1)));
x_102_phi = x_103;
x_105_phi = x_106;
}
}
x_135 = x_135_phi;
x_136 = x_136_phi;
bool const x_137 = x_137_phi;
x_139_phi = x_135;
if (x_137) {
break;
}
x_139_phi = x_136;
break;
}
}
float const x_139 = x_139_phi;
c.y = x_139;
float const x_141 = c.x;
float const x_142 = c.y;
c.z = (x_141 + x_142);
x_146_phi = 0;
while (true) {
int x_147 = 0;
int const x_146 = x_146_phi;
if ((x_146 < 3)) {
} else {
break;
}
int const x_152_save = x_146;
float const x_153 = c[x_152_save];
if ((x_153 >= 1.0f)) {
float const x_157 = c[x_152_save];
float const x_158 = c[x_152_save];
c[x_152_save] = (x_157 * x_158);
float const x_161 = x_6.injectionSwitch.x;
float const x_163 = x_6.injectionSwitch.y;
if ((x_161 > x_163)) {
discard_fragment();
}
}
{
x_147 = as_type<int>((as_type<uint>(x_146) + as_type<uint>(1)));
x_146_phi = x_147;
}
}
float3 const x_167 = c;
float3 const x_169 = normalize(fabs(x_167));
*(tint_symbol_6) = float4(x_169.x, x_169.y, x_169.z, 1.0f);
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_9 [[buffer(0)]], constant buf1& x_6 [[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_9, x_6, &(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;
}