2022-04-07 13:42:45 +00:00
|
|
|
#include <metal_stdlib>
|
2022-04-07 13:42:45 +00:00
|
|
|
|
2022-04-07 13:42:45 +00:00
|
|
|
using namespace metal;
|
2022-06-24 17:01:59 +00:00
|
|
|
|
|
|
|
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];
|
2022-04-07 13:42:45 +00:00
|
|
|
};
|
2022-04-07 13:42:45 +00:00
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
struct tint_private_vars_struct {
|
|
|
|
uint v;
|
|
|
|
};
|
|
|
|
|
2022-04-07 13:42:45 +00:00
|
|
|
struct S {
|
2022-06-24 17:01:59 +00:00
|
|
|
/* 0x0000 */ tint_array<int4, 4> a;
|
2022-04-07 13:42:45 +00:00
|
|
|
};
|
2022-04-07 13:42:45 +00:00
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx1(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx2(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx3(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx4(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx5(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
int idx6(thread tint_private_vars_struct* const tint_private_vars) {
|
|
|
|
(*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u);
|
2022-04-07 13:42:45 +00:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2023-03-20 21:46:01 +00:00
|
|
|
void tint_symbol_1(thread tint_private_vars_struct* const tint_private_vars, device tint_array<S, 1>* const tint_symbol_10) {
|
2022-04-07 13:42:45 +00:00
|
|
|
{
|
2023-03-20 21:46:01 +00:00
|
|
|
int const tint_symbol_6 = idx1(tint_private_vars);
|
|
|
|
int const tint_symbol_7 = idx2(tint_private_vars);
|
2023-03-02 17:18:27 +00:00
|
|
|
int const tint_symbol_2_save = tint_symbol_6;
|
|
|
|
int const tint_symbol_2_save_1 = tint_symbol_7;
|
2023-03-20 21:46:01 +00:00
|
|
|
int const tint_symbol_3 = idx3(tint_private_vars);
|
|
|
|
(*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3] = as_type<int>((as_type<uint>((*(tint_symbol_10))[tint_symbol_2_save].a[tint_symbol_2_save_1][tint_symbol_3]) + as_type<uint>(1)));
|
2022-04-07 13:42:45 +00:00
|
|
|
while (true) {
|
2023-03-20 21:46:01 +00:00
|
|
|
if (!(((*(tint_private_vars)).v < 10u))) {
|
2022-04-07 13:42:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
{
|
2023-03-20 21:46:01 +00:00
|
|
|
int const tint_symbol_8 = idx4(tint_private_vars);
|
|
|
|
int const tint_symbol_9 = idx5(tint_private_vars);
|
2022-04-07 13:42:45 +00:00
|
|
|
int const tint_symbol_4_save = tint_symbol_8;
|
|
|
|
int const tint_symbol_4_save_1 = tint_symbol_9;
|
2023-03-20 21:46:01 +00:00
|
|
|
int const tint_symbol_5 = idx6(tint_private_vars);
|
|
|
|
(*(tint_symbol_10))[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5] = as_type<int>((as_type<uint>((*(tint_symbol_10))[tint_symbol_4_save].a[tint_symbol_4_save_1][tint_symbol_5]) + as_type<uint>(1)));
|
2022-04-07 13:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-07 13:42:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|