blob: 18075425509a09ad15e134c29ec7686fa0da4ba5 [file] [log] [blame]
Antonio Maiorano9834fef2021-06-04 15:28:47 +00001#include <metal_stdlib>
2
3using namespace metal;
Ben Claytonf47887d2022-06-24 17:01:59 +00004
5template<typename T, size_t N>
6struct tint_array {
7 const constant T& operator[](size_t i) const constant { return elements[i]; }
8 device T& operator[](size_t i) device { return elements[i]; }
9 const device T& operator[](size_t i) const device { return elements[i]; }
10 thread T& operator[](size_t i) thread { return elements[i]; }
11 const thread T& operator[](size_t i) const thread { return elements[i]; }
12 threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
13 const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
14 T elements[N];
Antonio Maiorano9834fef2021-06-04 15:28:47 +000015};
Ben Clayton8ec32a62022-02-09 23:55:51 +000016
Antonio Maiorano9834fef2021-06-04 15:28:47 +000017struct tint_symbol_1 {
18 float4 value [[color(0)]];
19};
Antonio Maiorano9834fef2021-06-04 15:28:47 +000020
James Pricea5d73ce2021-08-04 22:15:28 +000021float4 tint_symbol_inner() {
Ben Claytonc64ca232022-06-29 00:55:36 +000022 int v1 = 1;
23 uint v2 = 1u;
24 float v3 = 1.0f;
25 int3 v4 = int3(1);
26 uint3 v5 = uint3(1u);
27 float3 v6 = float3(1.0f);
28 float3x3 v7 = float3x3(float3(1.0f), float3(1.0f), float3(1.0f));
29 tint_array<float, 10> v9 = tint_array<float, 10>{};
Ben Claytoncb6ddd22022-06-01 10:08:29 +000030 return float4(0.0f);
James Pricea5d73ce2021-08-04 22:15:28 +000031}
32
Antonio Maiorano9834fef2021-06-04 15:28:47 +000033fragment tint_symbol_1 tint_symbol() {
James Pricea5d73ce2021-08-04 22:15:28 +000034 float4 const inner_result = tint_symbol_inner();
35 tint_symbol_1 wrapper_result = {};
36 wrapper_result.value = inner_result;
37 return wrapper_result;
Antonio Maiorano9834fef2021-06-04 15:28:47 +000038}
39