Debian Codegraph @

third_party/spirv-cross/reference/opt/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 fragment main0_out main0(main0_in in [[stage_in]], uint gl_SampleID [[sample_id]])
87 {
88 main0_out out = {};
89 spvUnsafeArray<float2, 2> a = {};
90 _13 s = {};
91 spvUnsafeArray<float2, 2> b = {};
92 spvUnsafeArray<float2, 2> c = {};
93 a[0] = in.a_0.interpolate_at_center();
94 a[1] = in.a_1.interpolate_at_center();
95 s.x = in.m_13_x.interpolate_at_center();
96 s.y = in.m_13_y.interpolate_at_centroid();
97 s.z = in.m_13_z.interpolate_at_sample(gl_SampleID);
98 s.u[0] = in.m_13_u_0.interpolate_at_centroid();
99 s.u[1] = in.m_13_u_1.interpolate_at_centroid();
100 s.v[0] = in.m_13_v_0.interpolate_at_sample(gl_SampleID);
101 s.v[1] = in.m_13_v_1.interpolate_at_sample(gl_SampleID);
102 s.w[0] = in.m_13_w_0.interpolate_at_center();
103 s.w[1] = in.m_13_w_1.interpolate_at_center();
104 s.w[2] = in.m_13_w_2.interpolate_at_center();
105 b[0] = in.b_0.interpolate_at_centroid();
106 b[1] = in.b_1.interpolate_at_centroid();
107 c[0] = in.c_0.interpolate_at_sample(gl_SampleID);
108 c[1] = in.c_1.interpolate_at_sample(gl_SampleID);
109 out.FragColor = in.foo.interpolate_at_center();
110 out.FragColor += in.foo.interpolate_at_centroid();
111 out.FragColor += in.foo.interpolate_at_sample(in.sid);
112 out.FragColor += in.foo.interpolate_at_offset(float2(0.100000001490116119384765625) + 0.4375);
113 float3 _65 = out.FragColor.xyz + in.bar.interpolate_at_centroid();
114 out.FragColor = float4(_65.x, _65.y, _65.z, out.FragColor.w);
115 float3 _71 = out.FragColor.xyz + in.bar.interpolate_at_centroid();
116 out.FragColor = float4(_71.x, _71.y, _71.z, out.FragColor.w);
117 float3 _78 = out.FragColor.xyz + in.bar.interpolate_at_sample(in.sid);
118 out.FragColor = float4(_78.x, _78.y, _78.z, out.FragColor.w);
119 float3 _84 = out.FragColor.xyz + in.bar.interpolate_at_offset(float2(-0.100000001490116119384765625) + 0.4375);
120 out.FragColor = float4(_84.x, _84.y, _84.z, out.FragColor.w);
121 float2 _91 = out.FragColor.xy + b[0];
122 out.FragColor = float4(_91.x, _91.y, out.FragColor.z, out.FragColor.w);
123 float2 _98 = out.FragColor.xy + in.b_1.interpolate_at_centroid();
124 out.FragColor = float4(_98.x, _98.y, out.FragColor.z, out.FragColor.w);
125 float2 _105 = out.FragColor.xy + in.b_0.interpolate_at_sample(2);
126 out.FragColor = float4(_105.x, _105.y, out.FragColor.z, out.FragColor.w);
127 float2 _112 = out.FragColor.xy + in.b_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
128 out.FragColor = float4(_112.x, _112.y, out.FragColor.z, out.FragColor.w);
129 float2 _119 = out.FragColor.xy + c[0];
130 out.FragColor = float4(_119.x, _119.y, out.FragColor.z, out.FragColor.w);
131 float2 _127 = out.FragColor.xy + in.c_1.interpolate_at_centroid().xy;
132 out.FragColor = float4(_127.x, _127.y, out.FragColor.z, out.FragColor.w);
133 float2 _135 = out.FragColor.xy + in.c_0.interpolate_at_sample(2).yx;
134 out.FragColor = float4(_135.x, _135.y, out.FragColor.z, out.FragColor.w);
135 float2 _143 = out.FragColor.xy + in.c_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).xx;
136 out.FragColor = float4(_143.x, _143.y, out.FragColor.z, out.FragColor.w);
137 out.FragColor += s.x;
138 out.FragColor += in.m_13_x.interpolate_at_centroid();
139 out.FragColor += in.m_13_x.interpolate_at_sample(in.sid);
140 out.FragColor += in.m_13_x.interpolate_at_offset(float2(0.100000001490116119384765625) + 0.4375);
141 out.FragColor += s.y;
142 out.FragColor += in.m_13_y.interpolate_at_centroid();
143 out.FragColor += in.m_13_y.interpolate_at_sample(in.sid);
144 out.FragColor += in.m_13_y.interpolate_at_offset(float2(-0.100000001490116119384765625) + 0.4375);
145 float2 _184 = out.FragColor.xy + s.v[0];
146 out.FragColor = float4(_184.x, _184.y, out.FragColor.z, out.FragColor.w);
147 float2 _191 = out.FragColor.xy + in.m_13_v_1.interpolate_at_centroid();
148 out.FragColor = float4(_191.x, _191.y, out.FragColor.z, out.FragColor.w);
149 float2 _198 = out.FragColor.xy + in.m_13_v_0.interpolate_at_sample(2);
150 out.FragColor = float4(_198.x, _198.y, out.FragColor.z, out.FragColor.w);
151 float2 _205 = out.FragColor.xy + in.m_13_v_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
152 out.FragColor = float4(_205.x, _205.y, out.FragColor.z, out.FragColor.w);
153 out.FragColor.x += s.w[0];
154 out.FragColor.x += in.m_13_w_1.interpolate_at_centroid();
155 out.FragColor.x += in.m_13_w_0.interpolate_at_sample(2);
156 out.FragColor.x += in.m_13_w_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
157 float2 _328 = out.FragColor.xy + in.baz.interpolate_at_sample(gl_SampleID);
158 out.FragColor = float4(_328.x, _328.y, out.FragColor.z, out.FragColor.w);
159 out.FragColor.x += in.baz.interpolate_at_centroid().x;
160 out.FragColor.y += in.baz.interpolate_at_sample(3).y;
161 out.FragColor.z += in.baz.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).y;
162 float2 _353 = out.FragColor.xy + in.a_1.interpolate_at_centroid();
163 out.FragColor = float4(_353.x, _353.y, out.FragColor.z, out.FragColor.w);
164 float2 _360 = out.FragColor.xy + in.a_0.interpolate_at_sample(2);
165 out.FragColor = float4(_360.x, _360.y, out.FragColor.z, out.FragColor.w);
166 float2 _367 = out.FragColor.xy + in.a_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
167 out.FragColor = float4(_367.x, _367.y, out.FragColor.z, out.FragColor.w);
168 out.FragColor += s.z;
169 float2 _379 = out.FragColor.xy + in.m_13_z.interpolate_at_centroid().yy;
170 out.FragColor = float4(_379.x, _379.y, out.FragColor.z, out.FragColor.w);
171 float2 _387 = out.FragColor.yz + in.m_13_z.interpolate_at_sample(3).xy;
172 out.FragColor = float4(out.FragColor.x, _387.x, _387.y, out.FragColor.w);
173 float2 _395 = out.FragColor.zw + in.m_13_z.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375).wx;
174 out.FragColor = float4(out.FragColor.x, out.FragColor.y, _395.x, _395.y);
175 out.FragColor += s.u[0];
176 out.FragColor += in.m_13_u_1.interpolate_at_centroid();
177 out.FragColor += in.m_13_u_0.interpolate_at_sample(2);
178 out.FragColor += in.m_13_u_1.interpolate_at_offset(float2(-0.100000001490116119384765625, 0.100000001490116119384765625) + 0.4375);
179 return out;
180 }
181