blob: da51ebcc23a56791807baa8e79477dc4f3bb0b3c [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_1 {
float4 x_GLF_color_1 [[color(0)]];
};
bool collision_vf2_vf4_(thread float2* const pos, thread float4* const quad) {
bool4 x_116 = bool4(false, false, false, false);
float const x_118 = (*(pos)).x;
float const x_120 = (*(quad)).x;
if ((x_118 < x_120)) {
return false;
}
float const x_125 = (*(pos)).y;
float const x_127 = (*(quad)).y;
if ((x_125 < x_127)) {
return false;
}
float const x_132 = (*(pos)).x;
float const x_134 = (*(quad)).x;
float const x_136 = (*(quad)).z;
if ((x_132 > (x_134 + x_136))) {
return false;
}
float const x_142 = (*(pos)).y;
float const x_144 = (*(quad)).y;
float const x_146 = (*(quad)).w;
if ((x_142 > (x_144 + x_146))) {
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_156 = i;
if ((x_156 < 8)) {
} else {
break;
}
int const x_159 = i;
float2 const x_160 = *(pos_1);
param = x_160;
tint_array_wrapper_1 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)}};
indexable = tint_symbol_2;
float4 const x_162 = indexable.arr[x_159];
param_1 = x_162;
bool const x_163 = collision_vf2_vf4_(&(param), &(param_1));
if (x_163) {
int const x_166 = i;
tint_array_wrapper_1 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)}};
indexable_1 = tint_symbol_3;
float const x_168 = indexable_1.arr[x_166].x;
int const x_170 = i;
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_2 = tint_symbol_4;
float const x_172 = indexable_2.arr[x_170].y;
int const x_175 = i;
tint_array_wrapper_2 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)}};
indexable_3 = tint_symbol_5;
float4 const x_181 = indexable_3.arr[(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(int(x_168)) * as_type<uint>(int(x_172))))) + as_type<uint>(as_type<int>((as_type<uint>(x_175) * as_type<uint>(9))))))) + as_type<uint>(11))) % 16)];
res = x_181;
}
{
int const x_182 = i;
i = as_type<int>((as_type<uint>(x_182) + as_type<uint>(1)));
}
}
float4 const x_184 = res;
return x_184;
}
void main_1(constant buf0& x_20, thread float4* const tint_symbol_7, thread float4* const tint_symbol_8) {
float2 lin = 0.0f;
float2 param_2 = 0.0f;
float4 const x_105 = *(tint_symbol_7);
float2 const x_108 = x_20.resolution;
lin = (float2(x_105.x, x_105.y) / x_108);
float2 const x_110 = lin;
lin = floor((x_110 * 32.0f));
float2 const x_113 = lin;
param_2 = x_113;
float4 const x_114 = match_vf2_(&(param_2));
*(tint_symbol_8) = x_114;
return;
}
main_out tint_symbol_inner(constant buf0& x_20, 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_20, 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_20 [[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_20, 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;
}