| #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 { |
| device tint_array<uchar, 1>* v; |
| const constant tint_array<uint4, 1>* tint_storage_buffer_sizes; |
| }; |
| |
| struct tint_array_lengths_struct { |
| uint tint_array_length_0_0; |
| }; |
| |
| struct S { |
| /* 0x0000 */ float4 a; |
| /* 0x0010 */ tint_array<uint, 1> b; |
| /* 0x0014 */ tint_array<int8_t, 12> tint_pad; |
| }; |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void v_1(device tint_array<uchar, 1>* v [[buffer(0)]], 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, .tint_storage_buffer_sizes=tint_storage_buffer_sizes}; |
| bool const v_2 = (tint_array_lengths_struct{.tint_array_length_0_0=(*tint_module_vars.tint_storage_buffer_sizes)[0u].x}.tint_array_length_0_0 < 64u); |
| device S* const p = reinterpret_cast<device S*>(reinterpret_cast<device char*>(tint_module_vars.v) + select(0u, 0u, v_2)); |
| (*p).b[min(uint(4), (((select(64u, 20u, v_2) - 16u) / 4u) - 1u))] = 4u; |
| } |