| #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_packed_vec3_f32_array_element { |
| /* 0x0000 */ packed_float3 elements; |
| /* 0x000c */ tint_array<int8_t, 4> tint_pad; |
| }; |
| |
| struct Inner_tint_packed_vec3 { |
| /* 0x0000 */ tint_array<tint_packed_vec3_f32_array_element, 4> m; |
| }; |
| |
| struct Outer_tint_packed_vec3 { |
| /* 0x0000 */ tint_array<Inner_tint_packed_vec3, 4> a; |
| }; |
| |
| float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) { |
| float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements)); |
| return result; |
| } |
| |
| struct Inner { |
| float4x3 m; |
| }; |
| |
| Inner tint_unpack_vec3_in_composite_1(Inner_tint_packed_vec3 in) { |
| Inner result = {}; |
| result.m = tint_unpack_vec3_in_composite(in.m); |
| return result; |
| } |
| |
| tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) { |
| tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])}; |
| return result; |
| } |
| |
| struct Outer { |
| tint_array<Inner, 4> a; |
| }; |
| |
| Outer tint_unpack_vec3_in_composite_3(Outer_tint_packed_vec3 in) { |
| Outer result = {}; |
| result.a = tint_unpack_vec3_in_composite_2(in.a); |
| return result; |
| } |
| |
| tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) { |
| tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])}; |
| return result; |
| } |
| |
| kernel void f(const constant tint_array<Outer_tint_packed_vec3, 4>* tint_symbol [[buffer(0)]]) { |
| tint_array<Outer, 4> const l_a = tint_unpack_vec3_in_composite_4(*(tint_symbol)); |
| Outer const l_a_3 = tint_unpack_vec3_in_composite_3((*(tint_symbol))[3]); |
| tint_array<Inner, 4> const l_a_3_a = tint_unpack_vec3_in_composite_2((*(tint_symbol))[3].a); |
| Inner const l_a_3_a_2 = tint_unpack_vec3_in_composite_1((*(tint_symbol))[3].a[2]); |
| float4x3 const l_a_3_a_2_m = tint_unpack_vec3_in_composite((*(tint_symbol))[3].a[2].m); |
| float3 const l_a_3_a_2_m_1 = float3((*(tint_symbol))[3].a[2].m[1].elements); |
| float const l_a_3_a_2_m_1_0 = (*(tint_symbol))[3].a[2].m[1].elements[0]; |
| return; |
| } |
| |