blob: e311ccee51dcbeef90b6c1711739d07456b04562 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[18];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[4];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
};
struct buf2 {
/* 0x0000 */ int one;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf1& x_7, constant buf0& x_12, constant buf2& x_15, thread int* const tint_symbol_3, thread float4* const tint_symbol_4) {
float4x4 m = float4x4(0.0f);
float4 v = 0.0f;
float f = 0.0f;
int a = 0;
int b = 0;
float zero = 0.0f;
*(tint_symbol_3) = 0;
float const x_62 = x_7.x_GLF_uniform_float_values.arr[1].el;
float const x_64 = x_7.x_GLF_uniform_float_values.arr[2].el;
float const x_66 = x_7.x_GLF_uniform_float_values.arr[3].el;
float const x_68 = x_7.x_GLF_uniform_float_values.arr[4].el;
float const x_70 = x_7.x_GLF_uniform_float_values.arr[5].el;
float const x_72 = x_7.x_GLF_uniform_float_values.arr[6].el;
float const x_74 = x_7.x_GLF_uniform_float_values.arr[7].el;
float const x_76 = x_7.x_GLF_uniform_float_values.arr[8].el;
float const x_78 = x_7.x_GLF_uniform_float_values.arr[9].el;
float const x_80 = x_7.x_GLF_uniform_float_values.arr[10].el;
float const x_82 = x_7.x_GLF_uniform_float_values.arr[11].el;
float const x_84 = x_7.x_GLF_uniform_float_values.arr[12].el;
float const x_86 = x_7.x_GLF_uniform_float_values.arr[13].el;
float const x_88 = x_7.x_GLF_uniform_float_values.arr[14].el;
float const x_90 = x_7.x_GLF_uniform_float_values.arr[15].el;
float const x_92 = x_7.x_GLF_uniform_float_values.arr[16].el;
m = float4x4(float4(x_62, x_64, x_66, x_68), float4(x_70, x_72, x_74, x_76), float4(x_78, x_80, x_82, x_84), float4(x_86, x_88, x_90, x_92));
float const x_99 = x_7.x_GLF_uniform_float_values.arr[1].el;
float const x_101 = x_7.x_GLF_uniform_float_values.arr[2].el;
float const x_103 = x_7.x_GLF_uniform_float_values.arr[3].el;
float const x_105 = x_7.x_GLF_uniform_float_values.arr[4].el;
v = float4(x_99, x_101, x_103, x_105);
float const x_108 = x_7.x_GLF_uniform_float_values.arr[1].el;
f = x_108;
int const x_110 = x_12.x_GLF_uniform_int_values.arr[0].el;
a = x_110;
while (true) {
int const x_115 = *(tint_symbol_3);
if ((x_115 < 10)) {
} else {
break;
}
int const x_118 = *(tint_symbol_3);
*(tint_symbol_3) = as_type<int>((as_type<uint>(x_118) + as_type<uint>(1)));
int const x_120 = a;
int const x_121 = clamp(x_120, 0, 3);
float const x_123 = x_7.x_GLF_uniform_float_values.arr[1].el;
float const x_125 = v[x_121];
v[x_121] = (x_125 + x_123);
int const x_129 = x_12.x_GLF_uniform_int_values.arr[2].el;
b = x_129;
while (true) {
int const x_134 = *(tint_symbol_3);
if ((x_134 < 10)) {
} else {
break;
}
int const x_137 = *(tint_symbol_3);
*(tint_symbol_3) = as_type<int>((as_type<uint>(x_137) + as_type<uint>(1)));
int const x_139 = b;
float const x_142 = v[clamp(x_139, 0, 3)];
int const x_143 = b;
int const x_145 = a;
float const x_147 = m[clamp(x_143, 0, 3)][x_145];
float const x_149 = f;
f = (x_149 + (x_142 * x_147));
{
int const x_151 = b;
b = as_type<int>((as_type<uint>(x_151) - as_type<uint>(1)));
}
}
int const x_153 = a;
float const x_156 = x_7.x_GLF_uniform_float_values.arr[1].el;
m[1][clamp(x_153, 0, 3)] = x_156;
int const x_159 = x_15.one;
int const x_161 = x_12.x_GLF_uniform_int_values.arr[0].el;
if ((x_159 == x_161)) {
discard_fragment();
}
int const x_166 = x_15.one;
int const x_168 = x_12.x_GLF_uniform_int_values.arr[1].el;
if ((x_166 == x_168)) {
discard_fragment();
}
{
int const x_172 = a;
a = as_type<int>((as_type<uint>(x_172) + as_type<uint>(1)));
}
}
float const x_175 = x_7.x_GLF_uniform_float_values.arr[0].el;
zero = x_175;
float const x_176 = f;
float const x_178 = x_7.x_GLF_uniform_float_values.arr[17].el;
if (!((x_176 == x_178))) {
float const x_183 = x_7.x_GLF_uniform_float_values.arr[1].el;
zero = x_183;
}
float const x_184 = f;
float const x_185 = zero;
int const x_187 = x_12.x_GLF_uniform_int_values.arr[0].el;
float const x_189 = f;
*(tint_symbol_4) = float4(x_184, x_185, float(x_187), x_189);
return;
}
main_out tint_symbol_inner(constant buf1& x_7, constant buf0& x_12, constant buf2& x_15, thread int* const tint_symbol_5, thread float4* const tint_symbol_6) {
main_1(x_7, x_12, x_15, tint_symbol_5, tint_symbol_6);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf1& x_7 [[buffer(1)]], constant buf0& x_12 [[buffer(0)]], constant buf2& x_15 [[buffer(2)]]) {
thread int tint_symbol_7 = 0;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_7, x_12, x_15, &(tint_symbol_7), &(tint_symbol_8));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}