blob: 40b5eb8412382fc365fcbac4994764f64fbe0441 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct S {
tint_array<int4, 4> a;
};
struct tint_module_vars_struct {
device tint_array<S, 1>* tint_symbol;
thread uint* v;
};
int idx1(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 1;
}
int idx2(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 2;
}
int idx3(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 3;
}
int idx4(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 4;
}
int idx5(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 0;
}
int idx6(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.v) = ((*tint_module_vars.v) + 1u);
return 2;
}
void tint_symbol_1(tint_module_vars_struct tint_module_vars) {
{
int const v_1 = idx1(tint_module_vars);
device int4* const v_2 = (&(*tint_module_vars.tint_symbol)[v_1].a[idx2(tint_module_vars)]);
int const v_3 = idx3(tint_module_vars);
(*v_2)[v_3] = ((*v_2)[v_3] + 1);
while(true) {
if (((*tint_module_vars.v) < 10u)) {
} else {
break;
}
{
int const v_4 = idx4(tint_module_vars);
device int4* const v_5 = (&(*tint_module_vars.tint_symbol)[v_4].a[idx5(tint_module_vars)]);
int const v_6 = idx6(tint_module_vars);
(*v_5)[v_6] = ((*v_5)[v_6] + 1);
}
continue;
}
}
}