Debian Codegraph @

third_party/spirv-cross/reference/shaders-msl/asm/frag/pull-model-interpolation.asm.msl23.frag

raw
1 #pragma clang diagnostic ignored "-Wmissing-prototypes"
2 #pragma clang diagnostic ignored "-Wmissing-braces"
3
4 #include <metal_stdlib>
5 #include <simd/simd.h>
6
7 using namespace metal;
8
9 template<typename T, size_t Num>
10 struct spvUnsafeArray
11 {
12 T elements[Num ? Num : 1];
13
14 thread T& operator [] (size_t pos) thread
15 {
16 return elements[pos];
17 }
18 constexpr const thread T& operator [] (size_t pos) const thread
19 {
20 return elements[pos];
21 }
22
23 device T& operator [] (size_t pos) device
24 {
25 return elements[pos];
26 }
27 constexpr const device T& operator [] (size_t pos) const device
28 {
29 return elements[pos];
30 }
31
32 constexpr const constant T& operator [] (size_t pos) const constant
33 {
34 return elements[pos];
35 }
36
37 threadgroup T& operator [] (size_t pos) threadgroup
38 {
39 return elements[pos];
40 }
41 constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
42 {
43 return elements[pos];
44 }
45 };
46
47 struct _13
48 {
49 float4 x;
50 float4 y;
51 float4 z;
52 spvUnsafeArray<float4, 2> u;
53 spvUnsafeArray<float2, 2> v;
54 spvUnsafeArray<float, 3> w;
55 };
56
57 struct main0_out
58 {
59 float4 FragColor [[color(0)]];
60 };
61
62 struct main0_in
63 {
64 interpolant<float4, interpolation::no_perspective> foo [[user(locn0)]];
65 interpolant<float3, interpolation::perspective> bar [[user(locn1)]];
66 interpolant<float2, interpolation::perspective> baz [[user(locn2)]];
67 int sid [[user(locn3)]];
68 interpolant<float2, interpolation::perspective> a_0 [[user(locn4)]];
69 interpolant<float2, interpolation::perspective> a_1 [[user(locn5)]];
70 interpolant<float2, interpolation::perspective> b_0 [[user(locn6)]];
71 interpolant<float2, interpolation::perspective> b_1 [[user(locn7)]];
72 interpolant<float2, interpolation::perspective> c_0 [[user(locn8)]];
73 interpolant<float2, interpolation::perspective> c_1 [[user(locn9)]];
74 interpolant<float4, interpolation::perspective> m_13_x [[user(locn10)]];
75 interpolant<float4, interpolation::no_perspective> m_13_y [[user(locn11)]];
76 interpolant<float4, interpolation::perspective> m_13_z [[user(locn12)]];
77 interpolant<float4, interpolation::perspective> m_13_u_0 [[user(locn13)]];
78 interpolant<float4, interpolation::perspective> m_13_u_1 [[user(locn14)]];
79 interpolant<float2, interpolation::no_perspective> m_13_v_0 [[user(locn15)]];
80 interpolant<float2, interpolation::no_perspective> m_13_v_1 [[user(locn16)]];
81 interpolant<float, interpolation::perspective> m_13_w_0 [[user(locn17)]];
82 interpolant<float, interpolation::perspective> m_13_w_1 [[user(locn18)]];
83 interpolant<float, interpolation::perspective> m_13_w_2 [[user(locn19)]];
84 };
85
86 static inline __attribute__((always_inline))
87 void func(thread float4& FragColor, thread float2 baz, thread spvUnsafeArray<float2, 2> (&a), thread _13& s, thread main0_in& in)
88 {
89 float2 _237 = FragColor.xy + baz;
90 FragColor = float4(_237.x, _237.y, FragColor.z, FragColor.w);
91 FragColor.x += in.baz.interpolate_at_centroid().x;
92 FragColor.y += in.baz.interpolate_at_sample(3).y;
93 FragColor.z += in.baz.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).y;
94 float2 _262 = FragColor.xy + in.a_1.interpolate_at_centroid();
95 FragColor = float4(_262.x, _262.y, FragColor.z, FragColor.w);
96 float2 _269 = FragColor.xy + in.a_0.interpolate_at_sample(2);
97 FragColor = float4(_269.x, _269.y, FragColor.z, FragColor.w);
98 float2 _276 = FragColor.xy + in.a_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
99 FragColor = float4(_276.x, _276.y, FragColor.z, FragColor.w);
100 FragColor += s.z;
101 float2 _288 = FragColor.xy + in.m_13_z.interpolate_at_centroid().yy;
102 FragColor = float4(_288.x, _288.y, FragColor.z, FragColor.w);
103 float2 _296 = FragColor.yz + in.m_13_z.interpolate_at_sample(3).xy;
104 FragColor = float4(FragColor.x, _296.x, _296.y, FragColor.w);
105 float2 _304 = FragColor.zw + in.m_13_z.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).wx;
106 FragColor = float4(FragColor.x, FragColor.y, _304.x, _304.y);
107 FragColor += s.u[0];
108 FragColor += in.m_13_u_1.interpolate_at_centroid();
109 FragColor += in.m_13_u_0.interpolate_at_sample(2);
110 FragColor += in.m_13_u_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
111 }
112
113 fragment main0_out main0(main0_in in [[stage_in]], uint gl_SampleID [[sample_id]])
114 {
115 main0_out out = {};
116 spvUnsafeArray<float2, 2> a = {};
117 _13 s = {};
118 spvUnsafeArray<float2, 2> b = {};
119 spvUnsafeArray<float2, 2> c = {};
120 a[0] = in.a_0.interpolate_at_center();
121 a[1] = in.a_1.interpolate_at_center();
122 s.x = in.m_13_x.interpolate_at_center();
123 s.y = in.m_13_y.interpolate_at_centroid();
124 s.z = in.m_13_z.interpolate_at_sample(gl_SampleID);
125 s.u[0] = in.m_13_u_0.interpolate_at_centroid();
126 s.u[1] = in.m_13_u_1.interpolate_at_centroid();
127 s.v[0] = in.m_13_v_0.interpolate_at_sample(gl_SampleID);
128 s.v[1] = in.m_13_v_1.interpolate_at_sample(gl_SampleID);
129 s.w[0] = in.m_13_w_0.interpolate_at_center();
130 s.w[1] = in.m_13_w_1.interpolate_at_center();
131 s.w[2] = in.m_13_w_2.interpolate_at_center();
132 b[0] = in.b_0.interpolate_at_centroid();
133 b[1] = in.b_1.interpolate_at_centroid();
134 c[0] = in.c_0.interpolate_at_sample(gl_SampleID);
135 c[1] = in.c_1.interpolate_at_sample(gl_SampleID);
136 out.FragColor = in.foo.interpolate_at_center();
137 out.FragColor += in.foo.interpolate_at_centroid();
138 out.FragColor += in.foo.interpolate_at_sample(in.sid);
139 out.FragColor += in.foo.interpolate_at_offset(float2(0.100000001490116119384765625) + 0.4375);
140 float3 _65 = out.FragColor.xyz + in.bar.interpolate_at_centroid();
141 out.FragColor = float4(_65.x, _65.y, _65.z, out.FragColor.w);
142 float3 _71 = out.FragColor.xyz + in.bar.interpolate_at_centroid();
143 out.FragColor = float4(_71.x, _71.y, _71.z, out.FragColor.w);
144 float3 _78 = out.FragColor.xyz + in.bar.interpolate_at_sample(in.sid);
145 out.FragColor = float4(_78.x, _78.y, _78.z, out.FragColor.w);
146 float3 _84 = out.FragColor.xyz + in.bar.interpolate_at_offset(float2(-0.100000001490116119384765625) + 0.4375);
147 out.FragColor = float4(_84.x, _84.y, _84.z, out.FragColor.w);
148 float2 _91 = out.FragColor.xy + b[0];
149 out.FragColor = float4(_91.x, _91.y, out.FragColor.z, out.FragColor.w);
150 float2 _98 = out.FragColor.xy + in.b_1.interpolate_at_centroid();
151 out.FragColor = float4(_98.x, _98.y, out.FragColor.z, out.FragColor.w);
152 float2 _105 = out.FragColor.xy + in.b_0.interpolate_at_sample(2);
153 out.FragColor = float4(_105.x, _105.y, out.FragColor.z, out.FragColor.w);
154 float2 _112 = out.FragColor.xy + in.b_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
155 out.FragColor = float4(_112.x, _112.y, out.FragColor.z, out.FragColor.w);
156 float2 _119 = out.FragColor.xy + c[0];
157 out.FragColor = float4(_119.x, _119.y, out.FragColor.z, out.FragColor.w);
158 float2 _127 = out.FragColor.xy + in.c_1.interpolate_at_centroid().xy;
159 out.FragColor = float4(_127.x, _127.y, out.FragColor.z, out.FragColor.w);
160 float2 _135 = out.FragColor.xy + in.c_0.interpolate_at_sample(2).yx;
161 out.FragColor = float4(_135.x, _135.y, out.FragColor.z, out.FragColor.w);
162 float2 _143 = out.FragColor.xy + in.c_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).xx;
163 out.FragColor = float4(_143.x, _143.y, out.FragColor.z, out.FragColor.w);
164 out.FragColor += s.x;
165 out.FragColor += in.m_13_x.interpolate_at_centroid();
166 out.FragColor += in.m_13_x.interpolate_at_sample(in.sid);
167 out.FragColor += in.m_13_x.interpolate_at_offset(float2(0.100000001490116119384765625) + 0.4375);
168 out.FragColor += s.y;
169 out.FragColor += in.m_13_y.interpolate_at_centroid();
170 out.FragColor += in.m_13_y.interpolate_at_sample(in.sid);
171 out.FragColor += in.m_13_y.interpolate_at_offset(float2(-0.100000001490116119384765625) + 0.4375);
172 float2 _184 = out.FragColor.xy + s.v[0];
173 out.FragColor = float4(_184.x, _184.y, out.FragColor.z, out.FragColor.w);
174 float2 _191 = out.FragColor.xy + in.m_13_v_1.interpolate_at_centroid();
175 out.FragColor = float4(_191.x, _191.y, out.FragColor.z, out.FragColor.w);
176 float2 _198 = out.FragColor.xy + in.m_13_v_0.interpolate_at_sample(2);
177 out.FragColor = float4(_198.x, _198.y, out.FragColor.z, out.FragColor.w);
178 float2 _205 = out.FragColor.xy + in.m_13_v_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
179 out.FragColor = float4(_205.x, _205.y, out.FragColor.z, out.FragColor.w);
180 out.FragColor.x += s.w[0];
181 out.FragColor.x += in.m_13_w_1.interpolate_at_centroid();
182 out.FragColor.x += in.m_13_w_0.interpolate_at_sample(2);
183 out.FragColor.x += in.m_13_w_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
184 func(out.FragColor, in.baz.interpolate_at_sample(gl_SampleID), a, s, in);
185 return out;
186 }
187