| #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 { |
| /* 0x0000 */ int before; |
| /* 0x0004 */ tint_array<int8_t, 4> tint_pad; |
| /* 0x0008 */ half2x4 m; |
| /* 0x0018 */ tint_array<int8_t, 40> tint_pad_1; |
| /* 0x0040 */ int after; |
| /* 0x0044 */ tint_array<int8_t, 60> tint_pad_2; |
| }; |
| |
| void assign_and_preserve_padding_1(device S* const dest, S value) { |
| (*(dest)).before = value.before; |
| (*(dest)).m = value.m; |
| (*(dest)).after = value.after; |
| } |
| |
| void assign_and_preserve_padding(device tint_array<S, 4>* const dest, tint_array<S, 4> value) { |
| for(uint i = 0u; (i < 4u); i = (i + 1u)) { |
| assign_and_preserve_padding_1(&((*(dest))[i]), value[i]); |
| } |
| } |
| |
| kernel void f(device tint_array<S, 4>* tint_symbol [[buffer(1)]], const constant tint_array<S, 4>* tint_symbol_1 [[buffer(0)]]) { |
| assign_and_preserve_padding(tint_symbol, *(tint_symbol_1)); |
| assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]); |
| (*(tint_symbol))[3].m = (*(tint_symbol_1))[2].m; |
| (*(tint_symbol))[1].m[0] = half4((*(tint_symbol_1))[0].m[1]).ywxz; |
| return; |
| } |
| |