blob: 6e79a07e3500cfe39b06ce19d172be508d54bc12 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct tint_array_wrapper {
float4 arr[8];
};
struct tint_array_wrapper_1 {
float4 arr[16];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_6, thread float4* const tint_symbol_7, thread float4* const tint_symbol_8) {
tint_array_wrapper x_77 = {};
tint_array_wrapper x_78 = {};
tint_array_wrapper x_79 = {};
tint_array_wrapper_1 x_80 = {};
float4 x_89 = 0.0f;
float4 x_89_phi = 0.0f;
int x_92_phi = 0;
float4 const x_81 = *(tint_symbol_7);
float2 const x_84 = x_6.resolution;
float2 const x_87 = floor(((float2(x_81.x, x_81.y) / x_84) * 32.0f));
x_89_phi = float4(0.5f, 0.5f, 1.0f, 1.0f);
x_92_phi = 0;
while (true) {
float4 x_136 = 0.0f;
int x_93 = 0;
bool x_121_phi = false;
float4 x_90_phi = 0.0f;
x_89 = x_89_phi;
int const x_92 = x_92_phi;
if ((x_92 < 8)) {
} else {
break;
}
float4 x_98 = 0.0f;
tint_array_wrapper const tint_symbol_2 = {.arr={float4(4.0f, 4.0f, 20.0f, 4.0f), float4(4.0f, 4.0f, 4.0f, 20.0f), float4(4.0f, 20.0f, 20.0f, 4.0f), float4(20.0f, 4.0f, 4.0f, 8.0f), float4(8.0f, 6.0f, 4.0f, 2.0f), float4(2.0f, 12.0f, 2.0f, 4.0f), float4(16.0f, 2.0f, 4.0f, 4.0f), float4(12.0f, 22.0f, 4.0f, 4.0f)}};
x_77 = tint_symbol_2;
x_98 = x_77.arr[x_92];
switch(0u) {
default: {
float const x_101 = x_87.x;
float const x_102 = x_98.x;
if ((x_101 < x_102)) {
x_121_phi = false;
break;
}
float const x_106 = x_87.y;
float const x_107 = x_98.y;
if ((x_106 < x_107)) {
x_121_phi = false;
break;
}
if ((x_101 > (x_102 + x_98.z))) {
x_121_phi = false;
break;
}
if ((x_106 > (x_107 + x_98.w))) {
x_121_phi = false;
break;
}
x_121_phi = true;
break;
}
}
bool const x_121 = x_121_phi;
x_90_phi = x_89;
if (x_121) {
tint_array_wrapper const tint_symbol_3 = {.arr={float4(4.0f, 4.0f, 20.0f, 4.0f), float4(4.0f, 4.0f, 4.0f, 20.0f), float4(4.0f, 20.0f, 20.0f, 4.0f), float4(20.0f, 4.0f, 4.0f, 8.0f), float4(8.0f, 6.0f, 4.0f, 2.0f), float4(2.0f, 12.0f, 2.0f, 4.0f), float4(16.0f, 2.0f, 4.0f, 4.0f), float4(12.0f, 22.0f, 4.0f, 4.0f)}};
x_78 = tint_symbol_3;
float const x_125 = x_78.arr[x_92].x;
tint_array_wrapper const tint_symbol_4 = {.arr={float4(4.0f, 4.0f, 20.0f, 4.0f), float4(4.0f, 4.0f, 4.0f, 20.0f), float4(4.0f, 20.0f, 20.0f, 4.0f), float4(20.0f, 4.0f, 4.0f, 8.0f), float4(8.0f, 6.0f, 4.0f, 2.0f), float4(2.0f, 12.0f, 2.0f, 4.0f), float4(16.0f, 2.0f, 4.0f, 4.0f), float4(12.0f, 22.0f, 4.0f, 4.0f)}};
x_79 = tint_symbol_4;
float const x_128 = x_79.arr[x_92].y;
tint_array_wrapper_1 const tint_symbol_5 = {.arr={float4(0.0f, 0.0f, 0.0f, 1.0f), float4(0.5f, 0.0f, 0.0f, 1.0f), float4(0.0f, 0.5f, 0.0f, 1.0f), float4(0.5f, 0.5f, 0.0f, 1.0f), float4(0.0f, 0.0f, 0.5f, 1.0f), float4(0.5f, 0.0f, 0.5f, 1.0f), float4(0.0f, 0.5f, 0.5f, 1.0f), float4(0.5f, 0.5f, 0.5f, 1.0f), float4(0.0f, 0.0f, 0.0f, 1.0f), float4(1.0f, 0.0f, 0.0f, 1.0f), float4(0.0f, 1.0f, 0.0f, 1.0f), float4(1.0f, 1.0f, 0.0f, 1.0f), float4(0.0f, 0.0f, 1.0f, 1.0f), float4(1.0f, 0.0f, 1.0f, 1.0f), float4(0.0f, 1.0f, 1.0f, 1.0f), float4(1.0f, 1.0f, 1.0f, 1.0f)}};
x_80 = tint_symbol_5;
x_136 = x_80.arr[(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(int(x_125)) * as_type<uint>(int(x_128))))) + as_type<uint>(as_type<int>((as_type<uint>(x_92) * as_type<uint>(9))))))) + as_type<uint>(11))) % 16)];
x_90_phi = x_136;
}
float4 const x_90 = x_90_phi;
{
x_93 = as_type<int>((as_type<uint>(x_92) + as_type<uint>(1)));
x_89_phi = x_90;
x_92_phi = x_93;
}
}
*(tint_symbol_8) = x_89;
return;
}
main_out tint_symbol_inner(constant buf0& x_6, float4 gl_FragCoord_param, thread float4* const tint_symbol_9, thread float4* const tint_symbol_10) {
*(tint_symbol_9) = gl_FragCoord_param;
main_1(x_6, tint_symbol_9, tint_symbol_10);
main_out const tint_symbol_6 = {.x_GLF_color_1=*(tint_symbol_10)};
return tint_symbol_6;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_11 = 0.0f;
thread float4 tint_symbol_12 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_6, gl_FragCoord_param, &(tint_symbol_11), &(tint_symbol_12));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}