| #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 { |
| float a; |
| }; |
| |
| struct tint_private_vars_struct { |
| bool bool_var; |
| int i32_var; |
| uint u32_var; |
| float f32_var; |
| int2 v2i32_var; |
| uint3 v3u32_var; |
| float4 v4f32_var; |
| float2x3 m2x3_var; |
| tint_array<float, 4> arr_var; |
| S struct_var; |
| }; |
| |
| kernel void tint_symbol() { |
| thread tint_private_vars_struct tint_private_vars = {}; |
| tint_private_vars.bool_var = false; |
| tint_private_vars.i32_var = 0; |
| tint_private_vars.u32_var = 0u; |
| tint_private_vars.f32_var = 0.0f; |
| tint_private_vars.v2i32_var = int2(0); |
| tint_private_vars.v3u32_var = uint3(0u); |
| tint_private_vars.v4f32_var = float4(0.0f); |
| tint_private_vars.m2x3_var = float2x3(float3(0.0f), float3(0.0f)); |
| tint_private_vars.arr_var = tint_array<float, 4>{}; |
| tint_private_vars.struct_var = S{}; |
| tint_private_vars.bool_var = false; |
| tint_private_vars.i32_var = 0; |
| tint_private_vars.u32_var = 0u; |
| tint_private_vars.f32_var = 0.0f; |
| tint_private_vars.v2i32_var = int2(0); |
| tint_private_vars.v3u32_var = uint3(0u); |
| tint_private_vars.v4f32_var = float4(0.0f); |
| tint_private_vars.m2x3_var = float2x3(float3(0.0f), float3(0.0f)); |
| tint_array<float, 4> const tint_symbol_1 = tint_array<float, 4>{}; |
| tint_private_vars.arr_var = tint_symbol_1; |
| S const tint_symbol_2 = S{}; |
| tint_private_vars.struct_var = tint_symbol_2; |
| return; |
| } |
| |