blob: 8780c86dfec15ea96c95713c813109b0bdd0f12c [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct tint_array_wrapper {
int arr[16];
};
struct tint_array_wrapper_1 {
float4 arr[8];
};
struct tint_array_wrapper_2 {
float4 arr[16];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 [[color(0)]];
};
bool collision_vf2_vf4_(thread float2* const pos, thread float4* const quad) {
float const x_114 = (*(pos)).x;
float const x_116 = (*(quad)).x;
if ((x_114 < x_116)) {
return false;
}
float const x_121 = (*(pos)).y;
float const x_123 = (*(quad)).y;
if ((x_121 < x_123)) {
return false;
}
float const x_128 = (*(pos)).x;
float const x_130 = (*(quad)).x;
float const x_132 = (*(quad)).z;
if ((x_128 > (x_130 + x_132))) {
return false;
}
float const x_138 = (*(pos)).y;
float const x_140 = (*(quad)).y;
float const x_142 = (*(quad)).w;
if ((x_138 > (x_140 + x_142))) {
return false;
}
return true;
}
float4 match_vf2_(thread float2* const pos_1) {
float4 res = 0.0f;
int i = 0;
float2 param = 0.0f;
float4 param_1 = 0.0f;
tint_array_wrapper_1 indexable = {};
tint_array_wrapper_1 indexable_1 = {};
tint_array_wrapper_1 indexable_2 = {};
tint_array_wrapper_2 indexable_3 = {};
res = float4(0.5f, 0.5f, 1.0f, 1.0f);
i = 0;
while (true) {
int const x_152 = i;
if ((x_152 < 8)) {
} else {
break;
}
int const x_155 = i;
float2 const x_156 = *(pos_1);
param = x_156;
tint_array_wrapper_1 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)}};
indexable = tint_symbol_4;
float4 const x_158 = indexable.arr[x_155];
param_1 = x_158;
bool const x_159 = collision_vf2_vf4_(&(param), &(param_1));
if (x_159) {
int const x_162 = i;
tint_array_wrapper_1 const tint_symbol_5 = {.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)}};
indexable_1 = tint_symbol_5;
float const x_164 = indexable_1.arr[x_162].x;
int const x_166 = i;
tint_array_wrapper_1 const tint_symbol_6 = {.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)}};
indexable_2 = tint_symbol_6;
float const x_168 = indexable_2.arr[x_166].y;
int const x_171 = i;
tint_array_wrapper_2 const tint_symbol_7 = {.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)}};
indexable_3 = tint_symbol_7;
float4 const x_177 = indexable_3.arr[((((int(x_164) * int(x_168)) + (x_171 * 9)) + 11) % 16)];
res = x_177;
}
{
int const x_178 = i;
i = (x_178 + 1);
}
}
float4 const x_180 = res;
return x_180;
}
void main_1(constant buf0& x_20, thread float4* const tint_symbol_9, thread float4* const tint_symbol_10) {
float2 lin = 0.0f;
float2 param_2 = 0.0f;
float4 const x_102 = *(tint_symbol_9);
float2 const x_105 = x_20.resolution;
lin = (float2(x_102.x, x_102.y) / x_105);
float2 const x_107 = lin;
lin = floor((x_107 * 32.0f));
float2 const x_110 = lin;
param_2 = x_110;
float4 const x_111 = match_vf2_(&(param_2));
*(tint_symbol_10) = x_111;
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_20 [[buffer(0)]]) {
thread float4 tint_symbol_11 = 0.0f;
thread float4 tint_symbol_12 = 0.0f;
tint_symbol_11 = gl_FragCoord_param;
main_1(x_20, &(tint_symbol_11), &(tint_symbol_12));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_12};
tint_symbol_2 const tint_symbol_8 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_8;
}