| #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_private_vars_struct { |
| int counter; |
| }; |
| |
| struct tint_packed_vec3_f32_array_element { |
| /* 0x0000 */ packed_float3 elements; |
| /* 0x000c */ tint_array<int8_t, 4> tint_pad; |
| }; |
| |
| float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) { |
| float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements)); |
| return result; |
| } |
| |
| tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) { |
| tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])}; |
| return result; |
| } |
| |
| int i(thread tint_private_vars_struct* const tint_private_vars) { |
| (*(tint_private_vars)).counter = as_type<int>((as_type<uint>((*(tint_private_vars)).counter) + as_type<uint>(1))); |
| return (*(tint_private_vars)).counter; |
| } |
| |
| kernel void f(const constant tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4>* tint_symbol_2 [[buffer(0)]], device float* tint_symbol_3 [[buffer(1)]]) { |
| thread tint_private_vars_struct tint_private_vars = {}; |
| tint_private_vars.counter = 0; |
| int const tint_symbol = i(&(tint_private_vars)); |
| int const p_a_i_save = tint_symbol; |
| int const tint_symbol_1 = i(&(tint_private_vars)); |
| int const p_a_i_i_save = tint_symbol_1; |
| tint_array<float3x3, 4> const l_a = tint_unpack_vec3_in_composite_1(*(tint_symbol_2)); |
| float3x3 const l_a_i = tint_unpack_vec3_in_composite((*(tint_symbol_2))[p_a_i_save]); |
| float3 const l_a_i_i = float3((*(tint_symbol_2))[p_a_i_save][p_a_i_i_save].elements); |
| *(tint_symbol_3) = ((((*(tint_symbol_2))[p_a_i_save][p_a_i_i_save].elements[0] + l_a[0][0][0]) + l_a_i[0][0]) + l_a_i_i[0]); |
| return; |
| } |
| |