blob: f4067083ed9377ad78acb6dd32c7b801a08db010 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct tint_array_wrapper {
int arr[256];
};
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_6, thread float4* const tint_symbol_8, thread float4* const tint_symbol_9) {
tint_array_wrapper x_195 = {};
tint_array_wrapper x_196 = {};
tint_array_wrapper x_197 = {};
int2 x_209 = 0;
float4 x_241 = 0.0f;
float4 x_243 = 0.0f;
int2 x_213_phi = 0;
float4 x_243_phi = 0.0f;
bool x_244_phi = false;
float4 x_246_phi = 0.0f;
float4 const x_198 = *(tint_symbol_8);
float2 const x_201 = x_6.resolution;
float2 const x_202 = (float2(x_198.x, x_198.y) / x_201);
x_209 = int2(int((x_202.x * 256.0f)), int((x_202.y * 256.0f)));
switch(0u) {
default: {
x_213_phi = x_209;
while (true) {
bool x_230 = false;
bool x_231_phi = false;
int2 const x_213 = x_213_phi;
int const x_216 = x_213.y;
x_243_phi = float4(0.0f, 0.0f, 0.0f, 0.0f);
x_244_phi = false;
if ((x_216 != 256)) {
} else {
break;
}
int const x_220 = x_213.x;
tint_array_wrapper const tint_symbol_4 = {.arr={115, 133, 150, 164, 176, 184, 190, 192, 191, 187, 181, 172, 163, 153, 143, 134, 126, 120, 116, 114, 114, 117, 121, 127, 134, 141, 148, 154, 159, 162, 163, 161, 157, 151, 143, 134, 124, 113, 103, 94, 87, 82, 79, 80, 84, 91, 101, 114, 130, 146, 164, 182, 199, 215, 229, 240, 249, 254, 256, 254, 250, 243, 233, 223, 212, 200, 190, 180, 172, 166, 163, 161, 162, 164, 169, 174, 179, 185, 190, 193, 195, 195, 192, 188, 180, 171, 161, 149, 137, 125, 114, 105, 97, 93, 91, 93, 98, 106, 117, 130, 145, 161, 177, 193, 208, 221, 231, 239, 243, 244, 242, 236, 228, 218, 207, 194, 181, 169, 158, 148, 141, 135, 132, 131, 132, 135, 138, 143, 147, 151, 154, 155, 155, 152, 146, 139, 129, 118, 106, 93, 80, 68, 58, 49, 43, 40, 41, 44, 51, 61, 73, 87, 103, 119, 134, 149, 162, 173, 181, 186, 188, 186, 181, 174, 164, 153, 141, 128, 116, 104, 94, 86, 81, 77, 76, 77, 80, 84, 89, 94, 98, 102, 104, 104, 102, 98, 92, 83, 73, 62, 50, 38, 26, 16, 8, 2, 0, 0, 4, 11, 21, 33, 48, 64, 81, 98, 114, 129, 141, 151, 158, 161, 161, 158, 152, 144, 134, 123, 112, 100, 90, 81, 73, 68, 65, 65, 67, 70, 75, 81, 87, 92, 97, 101, 103, 102, 100, 95, 88, 79, 69, 58, 47, 36, 26, 18, 13, 11, 11, 15, 22, 32, 45, 60, 77, 94}};
x_195 = tint_symbol_4;
int const x_222 = x_195.arr[x_216];
bool const x_224 = (x_220 < as_type<int>((as_type<uint>(x_222) + as_type<uint>(15))));
x_231_phi = x_224;
if (x_224) {
tint_array_wrapper const tint_symbol_5 = {.arr={115, 133, 150, 164, 176, 184, 190, 192, 191, 187, 181, 172, 163, 153, 143, 134, 126, 120, 116, 114, 114, 117, 121, 127, 134, 141, 148, 154, 159, 162, 163, 161, 157, 151, 143, 134, 124, 113, 103, 94, 87, 82, 79, 80, 84, 91, 101, 114, 130, 146, 164, 182, 199, 215, 229, 240, 249, 254, 256, 254, 250, 243, 233, 223, 212, 200, 190, 180, 172, 166, 163, 161, 162, 164, 169, 174, 179, 185, 190, 193, 195, 195, 192, 188, 180, 171, 161, 149, 137, 125, 114, 105, 97, 93, 91, 93, 98, 106, 117, 130, 145, 161, 177, 193, 208, 221, 231, 239, 243, 244, 242, 236, 228, 218, 207, 194, 181, 169, 158, 148, 141, 135, 132, 131, 132, 135, 138, 143, 147, 151, 154, 155, 155, 152, 146, 139, 129, 118, 106, 93, 80, 68, 58, 49, 43, 40, 41, 44, 51, 61, 73, 87, 103, 119, 134, 149, 162, 173, 181, 186, 188, 186, 181, 174, 164, 153, 141, 128, 116, 104, 94, 86, 81, 77, 76, 77, 80, 84, 89, 94, 98, 102, 104, 104, 102, 98, 92, 83, 73, 62, 50, 38, 26, 16, 8, 2, 0, 0, 4, 11, 21, 33, 48, 64, 81, 98, 114, 129, 141, 151, 158, 161, 161, 158, 152, 144, 134, 123, 112, 100, 90, 81, 73, 68, 65, 65, 67, 70, 75, 81, 87, 92, 97, 101, 103, 102, 100, 95, 88, 79, 69, 58, 47, 36, 26, 18, 13, 11, 11, 15, 22, 32, 45, 60, 77, 94}};
x_196 = tint_symbol_5;
int const x_228 = x_196.arr[x_216];
x_230 = (x_220 > as_type<int>((as_type<uint>(x_228) - as_type<uint>(15))));
x_231_phi = x_230;
}
bool const x_231 = x_231_phi;
if (x_231) {
tint_array_wrapper const tint_symbol_6 = {.arr={115, 133, 150, 164, 176, 184, 190, 192, 191, 187, 181, 172, 163, 153, 143, 134, 126, 120, 116, 114, 114, 117, 121, 127, 134, 141, 148, 154, 159, 162, 163, 161, 157, 151, 143, 134, 124, 113, 103, 94, 87, 82, 79, 80, 84, 91, 101, 114, 130, 146, 164, 182, 199, 215, 229, 240, 249, 254, 256, 254, 250, 243, 233, 223, 212, 200, 190, 180, 172, 166, 163, 161, 162, 164, 169, 174, 179, 185, 190, 193, 195, 195, 192, 188, 180, 171, 161, 149, 137, 125, 114, 105, 97, 93, 91, 93, 98, 106, 117, 130, 145, 161, 177, 193, 208, 221, 231, 239, 243, 244, 242, 236, 228, 218, 207, 194, 181, 169, 158, 148, 141, 135, 132, 131, 132, 135, 138, 143, 147, 151, 154, 155, 155, 152, 146, 139, 129, 118, 106, 93, 80, 68, 58, 49, 43, 40, 41, 44, 51, 61, 73, 87, 103, 119, 134, 149, 162, 173, 181, 186, 188, 186, 181, 174, 164, 153, 141, 128, 116, 104, 94, 86, 81, 77, 76, 77, 80, 84, 89, 94, 98, 102, 104, 104, 102, 98, 92, 83, 73, 62, 50, 38, 26, 16, 8, 2, 0, 0, 4, 11, 21, 33, 48, 64, 81, 98, 114, 129, 141, 151, 158, 161, 161, 158, 152, 144, 134, 123, 112, 100, 90, 81, 73, 68, 65, 65, 67, 70, 75, 81, 87, 92, 97, 101, 103, 102, 100, 95, 88, 79, 69, 58, 47, 36, 26, 18, 13, 11, 11, 15, 22, 32, 45, 60, 77, 94}};
x_197 = tint_symbol_6;
int const x_235 = x_197.arr[x_216];
float const x_240 = ((15.0f - fabs(float(as_type<int>((as_type<uint>(x_220) - as_type<uint>(x_235)))))) * 0.06666667f);
x_241 = float4(x_240, x_240, x_240, 1.0f);
x_243_phi = x_241;
x_244_phi = true;
break;
}
int2 x_214_1 = x_213;
x_214_1.y = as_type<int>((as_type<uint>(x_216) + as_type<uint>(1)));
int2 const x_214 = x_214_1;
{
x_213_phi = x_214;
}
}
x_243 = x_243_phi;
bool const x_244 = x_244_phi;
x_246_phi = x_243;
if (x_244) {
break;
}
x_246_phi = float4(0.0f, 0.0f, 0.0f, 1.0f);
break;
}
}
float4 const x_246 = x_246_phi;
*(tint_symbol_9) = x_246;
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_10 = 0.0f;
thread float4 tint_symbol_11 = 0.0f;
tint_symbol_10 = gl_FragCoord_param;
main_1(x_6, &(tint_symbol_10), &(tint_symbol_11));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_11};
tint_symbol_2 const tint_symbol_7 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_7;
}