dawn-cmake/test/vk-gl-cts/graphicsfuzz/cov-value-tracking-selectio.../0-opt.wgsl.expected.msl

179 lines
5.9 KiB
Plaintext

#include <metal_stdlib>
using namespace metal;
int tint_unary_minus(const int v) {
return select(-v, v, v == -2147483648);
}
struct tint_padded_array_element {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[16];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
};
struct tint_array_wrapper_1 {
int arr[15];
};
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_3) {
tint_array_wrapper_1 ref = {};
int i = 0;
tint_array_wrapper_1 data = {};
int i_1 = 0;
int i_2 = 0;
int i_3 = 0;
int const x_46 = x_6.x_GLF_uniform_int_values.arr[0].el;
int const x_48 = x_6.x_GLF_uniform_int_values.arr[0].el;
ref.arr[x_46] = x_48;
int const x_51 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_53 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_51] = x_53;
int const x_56 = x_6.x_GLF_uniform_int_values.arr[2].el;
int const x_58 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_56] = x_58;
int const x_61 = x_6.x_GLF_uniform_int_values.arr[3].el;
int const x_63 = x_6.x_GLF_uniform_int_values.arr[3].el;
ref.arr[x_61] = x_63;
int const x_66 = x_6.x_GLF_uniform_int_values.arr[4].el;
int const x_68 = x_6.x_GLF_uniform_int_values.arr[4].el;
ref.arr[x_66] = x_68;
int const x_71 = x_6.x_GLF_uniform_int_values.arr[5].el;
int const x_73 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_71] = tint_unary_minus(x_73);
int const x_77 = x_6.x_GLF_uniform_int_values.arr[8].el;
int const x_79 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_77] = tint_unary_minus(x_79);
int const x_83 = x_6.x_GLF_uniform_int_values.arr[9].el;
int const x_85 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_83] = tint_unary_minus(x_85);
int const x_89 = x_6.x_GLF_uniform_int_values.arr[10].el;
int const x_91 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_89] = tint_unary_minus(x_91);
int const x_95 = x_6.x_GLF_uniform_int_values.arr[11].el;
int const x_97 = x_6.x_GLF_uniform_int_values.arr[1].el;
ref.arr[x_95] = tint_unary_minus(x_97);
int const x_101 = x_6.x_GLF_uniform_int_values.arr[6].el;
int const x_103 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_101] = tint_unary_minus(x_103);
int const x_107 = x_6.x_GLF_uniform_int_values.arr[12].el;
int const x_109 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_107] = tint_unary_minus(x_109);
int const x_113 = x_6.x_GLF_uniform_int_values.arr[13].el;
int const x_115 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_113] = tint_unary_minus(x_115);
int const x_119 = x_6.x_GLF_uniform_int_values.arr[14].el;
int const x_121 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_119] = tint_unary_minus(x_121);
int const x_125 = x_6.x_GLF_uniform_int_values.arr[15].el;
int const x_127 = x_6.x_GLF_uniform_int_values.arr[2].el;
ref.arr[x_125] = tint_unary_minus(x_127);
i = 0;
while (true) {
int const x_134 = i;
int const x_136 = x_6.x_GLF_uniform_int_values.arr[5].el;
if ((x_134 < x_136)) {
} else {
break;
}
int const x_139 = i;
int const x_140 = i;
int const x_142 = i;
int const x_145 = x_6.x_GLF_uniform_int_values.arr[1].el;
data.arr[x_139] = ~(clamp(~(x_140), ~(x_142), x_145));
{
int const x_149 = i;
i = as_type<int>((as_type<uint>(x_149) + as_type<uint>(1)));
}
}
int const x_152 = x_6.x_GLF_uniform_int_values.arr[5].el;
i_1 = x_152;
while (true) {
int const x_157 = i_1;
int const x_159 = x_6.x_GLF_uniform_int_values.arr[6].el;
if ((x_157 < x_159)) {
} else {
break;
}
int const x_162 = i_1;
int const x_163 = i_1;
data.arr[x_162] = ~(clamp(~(x_163), 0, 1));
{
int const x_168 = i_1;
i_1 = as_type<int>((as_type<uint>(x_168) + as_type<uint>(1)));
}
}
int const x_171 = x_6.x_GLF_uniform_int_values.arr[6].el;
i_2 = x_171;
while (true) {
int const x_176 = i_2;
int const x_178 = x_6.x_GLF_uniform_int_values.arr[7].el;
if ((x_176 < x_178)) {
} else {
break;
}
int const x_181 = i_2;
int const x_182 = i_2;
data.arr[x_181] = ~(clamp(x_182, 0, 1));
{
int const x_186 = i_2;
i_2 = as_type<int>((as_type<uint>(x_186) + as_type<uint>(1)));
}
}
int const x_189 = x_6.x_GLF_uniform_int_values.arr[0].el;
i_3 = x_189;
while (true) {
int const x_194 = i_3;
int const x_196 = x_6.x_GLF_uniform_int_values.arr[7].el;
if ((x_194 < x_196)) {
} else {
break;
}
int const x_199 = i_3;
int const x_201 = data.arr[x_199];
int const x_202 = i_3;
int const x_204 = ref.arr[x_202];
if ((x_201 != x_204)) {
int const x_209 = x_6.x_GLF_uniform_int_values.arr[0].el;
float const x_210 = float(x_209);
*(tint_symbol_3) = float4(x_210, x_210, x_210, x_210);
return;
}
{
int const x_212 = i_3;
i_3 = as_type<int>((as_type<uint>(x_212) + as_type<uint>(1)));
}
}
int const x_215 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_218 = x_6.x_GLF_uniform_int_values.arr[0].el;
int const x_221 = x_6.x_GLF_uniform_int_values.arr[0].el;
int const x_224 = x_6.x_GLF_uniform_int_values.arr[1].el;
*(tint_symbol_3) = float4(float(x_215), float(x_218), float(x_221), float(x_224));
return;
}
main_out tint_symbol_inner(constant buf0& x_6, thread float4* const tint_symbol_4) {
main_1(x_6, tint_symbol_4);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_4)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_6, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}