| #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 tint_module_vars_struct { |
| const device tint_array<uchar, 1>* v; |
| device uint4* out; |
| const constant tint_array<uint4, 1>* tint_storage_buffer_sizes; |
| }; |
| |
| struct tint_array_lengths_struct { |
| uint tint_array_length_0_0; |
| }; |
| |
| fragment void v_1(const device tint_array<uchar, 1>* v [[buffer(0)]], device uint4* out [[buffer(1)]], const constant tint_array<uint4, 1>* tint_storage_buffer_sizes [[buffer(30)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v=v, .out=out, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; |
| tint_array_lengths_struct const v_2 = tint_array_lengths_struct{.tint_array_length_0_0=(*tint_module_vars.tint_storage_buffer_sizes)[0u].x}; |
| uint const offset = 16u; |
| (*tint_module_vars.out) = (*reinterpret_cast<const device tint_array<uint4, 1>*>(reinterpret_cast<const device char*>(tint_module_vars.v) + select((offset & 4294967280u), 0u, (v_2.tint_array_length_0_0 < (16u + (offset & 4294967280u))))))[min(uint(0), ((((select(select(16u, 16u, (v_2.tint_array_length_0_0 < (16u + (offset & 4294967280u)))), select(0u, v_2.tint_array_length_0_0, (0u == 0u)), (select(16u, 16u, (v_2.tint_array_length_0_0 < (16u + (offset & 4294967280u)))) == 0u)) - select(0u, select((offset & 4294967280u), 0u, (v_2.tint_array_length_0_0 < (16u + (offset & 4294967280u)))), (select(16u, 16u, (v_2.tint_array_length_0_0 < (16u + (offset & 4294967280u)))) == 0u))) - 0u) / 16u) - 1u))]; |
| } |