dawn-cmake/test/vk-gl-cts/graphicsfuzz/spv-declare-bvec4/1.wgsl.expected.msl

124 lines
4.7 KiB
Plaintext

#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) {
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_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_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_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_168 = indexable_1.arr[x_166].x;
int const x_170 = 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_172 = indexable_2.arr[x_170].y;
int const x_175 = 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_181 = indexable_3.arr[((((int(x_168) * int(x_172)) + (x_175 * 9)) + 11) % 16)];
res = x_181;
}
{
int const x_182 = i;
i = (x_182 + 1);
}
}
float4 const x_184 = res;
return x_184;
}
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_105 = *(tint_symbol_9);
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_10) = x_114;
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;
}