| #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]; |
| }; |
| |
| #define TINT_ISOLATE_UB(VOLATILE_NAME) \ |
| {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;} |
| |
| struct tint_private_vars_struct { |
| uint v; |
| }; |
| |
| struct TintArrayLengths { |
| /* 0x0000 */ tint_array<uint4, 1> array_lengths; |
| }; |
| |
| struct S { |
| /* 0x0000 */ tint_array<int4, 4> a; |
| }; |
| |
| int idx1(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 1; |
| } |
| |
| int idx2(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 2; |
| } |
| |
| int idx3(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 3; |
| } |
| |
| int idx4(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 4; |
| } |
| |
| int idx5(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 0; |
| } |
| |
| int idx6(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).v = ((*(tint_private_vars)).v + 1u); |
| return 2; |
| } |
| |
| void tint_symbol_1(thread tint_private_vars_struct* const tint_private_vars, const constant TintArrayLengths* const tint_symbol_10, device tint_array<S, 1>* const tint_symbol_11) { |
| { |
| int const tint_symbol_6 = idx1(tint_private_vars); |
| int const tint_symbol_7 = idx2(tint_private_vars); |
| uint const tint_symbol_2_save = min(uint(tint_symbol_6), (((*(tint_symbol_10)).array_lengths[0u][0u] / 64u) - 1u)); |
| uint const tint_symbol_2_save_1 = min(uint(tint_symbol_7), 3u); |
| int const tint_symbol_3 = idx3(tint_private_vars); |
| (*(tint_symbol_11))[tint_symbol_2_save].a[tint_symbol_2_save_1][min(uint(tint_symbol_3), 3u)] = as_type<int>((as_type<uint>((*(tint_symbol_11))[tint_symbol_2_save].a[tint_symbol_2_save_1][min(uint(tint_symbol_3), 3u)]) + as_type<uint>(1))); |
| while(true) { |
| TINT_ISOLATE_UB(tint_volatile_false); |
| if (!(((*(tint_private_vars)).v < 10u))) { |
| break; |
| } |
| { |
| } |
| { |
| int const tint_symbol_8 = idx4(tint_private_vars); |
| int const tint_symbol_9 = idx5(tint_private_vars); |
| uint const tint_symbol_4_save = min(uint(tint_symbol_8), (((*(tint_symbol_10)).array_lengths[0u][0u] / 64u) - 1u)); |
| uint const tint_symbol_4_save_1 = min(uint(tint_symbol_9), 3u); |
| int const tint_symbol_5 = idx6(tint_private_vars); |
| (*(tint_symbol_11))[tint_symbol_4_save].a[tint_symbol_4_save_1][min(uint(tint_symbol_5), 3u)] = as_type<int>((as_type<uint>((*(tint_symbol_11))[tint_symbol_4_save].a[tint_symbol_4_save_1][min(uint(tint_symbol_5), 3u)]) + as_type<uint>(1))); |
| } |
| } |
| } |
| } |
| |