| #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; |
| }; |
| |
| bool ret_bool() { |
| return false; |
| } |
| |
| int ret_i32() { |
| return 0; |
| } |
| |
| uint ret_u32() { |
| return 0u; |
| } |
| |
| float ret_f32() { |
| return 0.0f; |
| } |
| |
| int2 ret_v2i32() { |
| return int2(0); |
| } |
| |
| uint3 ret_v3u32() { |
| return uint3(0u); |
| } |
| |
| float4 ret_v4f32() { |
| return float4(0.0f); |
| } |
| |
| float2x3 ret_m2x3() { |
| return float2x3(float3(0.0f), float3(0.0f)); |
| } |
| |
| tint_array<float, 4> ret_arr() { |
| tint_array<float, 4> const tint_symbol_1 = tint_array<float, 4>{}; |
| return tint_symbol_1; |
| } |
| |
| S ret_struct() { |
| S const tint_symbol_2 = S{}; |
| return tint_symbol_2; |
| } |
| |
| kernel void tint_symbol() { |
| return; |
| } |
| |