3 #extension GL_KHR_shader_subgroup_clustered: enable
\r
4 #extension GL_EXT_shader_subgroup_extended_types_int8: enable
\r
5 #extension GL_EXT_shader_subgroup_extended_types_int16: enable
\r
6 #extension GL_EXT_shader_subgroup_extended_types_int64: enable
\r
7 #extension GL_EXT_shader_subgroup_extended_types_float16: enable
\r
9 layout (local_size_x = 8) in;
\r
11 layout(binding = 0) buffer Buffers
\r
24 uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4;
\r
26 data[invocation].i8.x = subgroupClusteredAdd(data[0].i8.x, 1);
\r
27 data[invocation].i8.xy = subgroupClusteredAdd(data[1].i8.xy, 1);
\r
28 data[invocation].i8.xyz = subgroupClusteredAdd(data[2].i8.xyz, 1);
\r
29 data[invocation].i8 = subgroupClusteredAdd(data[3].i8, 1);
\r
31 data[invocation].i8.x = subgroupClusteredMul(data[0].i8.x, 1);
\r
32 data[invocation].i8.xy = subgroupClusteredMul(data[1].i8.xy, 1);
\r
33 data[invocation].i8.xyz = subgroupClusteredMul(data[2].i8.xyz, 1);
\r
34 data[invocation].i8 = subgroupClusteredMul(data[3].i8, 1);
\r
36 data[invocation].i8.x = subgroupClusteredMin(data[0].i8.x, 1);
\r
37 data[invocation].i8.xy = subgroupClusteredMin(data[1].i8.xy, 1);
\r
38 data[invocation].i8.xyz = subgroupClusteredMin(data[2].i8.xyz, 1);
\r
39 data[invocation].i8 = subgroupClusteredMin(data[3].i8, 1);
\r
41 data[invocation].i8.x = subgroupClusteredMax(data[0].i8.x, 1);
\r
42 data[invocation].i8.xy = subgroupClusteredMax(data[1].i8.xy, 1);
\r
43 data[invocation].i8.xyz = subgroupClusteredMax(data[2].i8.xyz, 1);
\r
44 data[invocation].i8 = subgroupClusteredMax(data[3].i8, 1);
\r
46 data[invocation].i8.x = subgroupClusteredAnd(data[0].i8.x, 1);
\r
47 data[invocation].i8.xy = subgroupClusteredAnd(data[1].i8.xy, 1);
\r
48 data[invocation].i8.xyz = subgroupClusteredAnd(data[2].i8.xyz, 1);
\r
49 data[invocation].i8 = subgroupClusteredAnd(data[3].i8, 1);
\r
51 data[invocation].i8.x = subgroupClusteredOr(data[0].i8.x, 1);
\r
52 data[invocation].i8.xy = subgroupClusteredOr(data[1].i8.xy, 1);
\r
53 data[invocation].i8.xyz = subgroupClusteredOr(data[2].i8.xyz, 1);
\r
54 data[invocation].i8 = subgroupClusteredOr(data[3].i8, 1);
\r
56 data[invocation].i8.x = subgroupClusteredXor(data[0].i8.x, 1);
\r
57 data[invocation].i8.xy = subgroupClusteredXor(data[1].i8.xy, 1);
\r
58 data[invocation].i8.xyz = subgroupClusteredXor(data[2].i8.xyz, 1);
\r
59 data[invocation].i8 = subgroupClusteredXor(data[3].i8, 1);
\r
61 data[invocation].u8.x = subgroupClusteredAdd(data[0].u8.x, 1);
\r
62 data[invocation].u8.xy = subgroupClusteredAdd(data[1].u8.xy, 1);
\r
63 data[invocation].u8.xyz = subgroupClusteredAdd(data[2].u8.xyz, 1);
\r
64 data[invocation].u8 = subgroupClusteredAdd(data[3].u8, 1);
\r
66 data[invocation].u8.x = subgroupClusteredMul(data[0].u8.x, 1);
\r
67 data[invocation].u8.xy = subgroupClusteredMul(data[1].u8.xy, 1);
\r
68 data[invocation].u8.xyz = subgroupClusteredMul(data[2].u8.xyz, 1);
\r
69 data[invocation].u8 = subgroupClusteredMul(data[3].u8, 1);
\r
71 data[invocation].u8.x = subgroupClusteredMin(data[0].u8.x, 1);
\r
72 data[invocation].u8.xy = subgroupClusteredMin(data[1].u8.xy, 1);
\r
73 data[invocation].u8.xyz = subgroupClusteredMin(data[2].u8.xyz, 1);
\r
74 data[invocation].u8 = subgroupClusteredMin(data[3].u8, 1);
\r
76 data[invocation].u8.x = subgroupClusteredMax(data[0].u8.x, 1);
\r
77 data[invocation].u8.xy = subgroupClusteredMax(data[1].u8.xy, 1);
\r
78 data[invocation].u8.xyz = subgroupClusteredMax(data[2].u8.xyz, 1);
\r
79 data[invocation].u8 = subgroupClusteredMax(data[3].u8, 1);
\r
81 data[invocation].u8.x = subgroupClusteredAnd(data[0].u8.x, 1);
\r
82 data[invocation].u8.xy = subgroupClusteredAnd(data[1].u8.xy, 1);
\r
83 data[invocation].u8.xyz = subgroupClusteredAnd(data[2].u8.xyz, 1);
\r
84 data[invocation].u8 = subgroupClusteredAnd(data[3].u8, 1);
\r
86 data[invocation].u8.x = subgroupClusteredOr(data[0].u8.x, 1);
\r
87 data[invocation].u8.xy = subgroupClusteredOr(data[1].u8.xy, 1);
\r
88 data[invocation].u8.xyz = subgroupClusteredOr(data[2].u8.xyz, 1);
\r
89 data[invocation].u8 = subgroupClusteredOr(data[3].u8, 1);
\r
91 data[invocation].u8.x = subgroupClusteredXor(data[0].u8.x, 1);
\r
92 data[invocation].u8.xy = subgroupClusteredXor(data[1].u8.xy, 1);
\r
93 data[invocation].u8.xyz = subgroupClusteredXor(data[2].u8.xyz, 1);
\r
94 data[invocation].u8 = subgroupClusteredXor(data[3].u8, 1);
\r
96 data[invocation].i16.x = subgroupClusteredAdd(data[0].i16.x, 1);
\r
97 data[invocation].i16.xy = subgroupClusteredAdd(data[1].i16.xy, 1);
\r
98 data[invocation].i16.xyz = subgroupClusteredAdd(data[2].i16.xyz, 1);
\r
99 data[invocation].i16 = subgroupClusteredAdd(data[3].i16, 1);
\r
101 data[invocation].i16.x = subgroupClusteredMul(data[0].i16.x, 1);
\r
102 data[invocation].i16.xy = subgroupClusteredMul(data[1].i16.xy, 1);
\r
103 data[invocation].i16.xyz = subgroupClusteredMul(data[2].i16.xyz, 1);
\r
104 data[invocation].i16 = subgroupClusteredMul(data[3].i16, 1);
\r
106 data[invocation].i16.x = subgroupClusteredMin(data[0].i16.x, 1);
\r
107 data[invocation].i16.xy = subgroupClusteredMin(data[1].i16.xy, 1);
\r
108 data[invocation].i16.xyz = subgroupClusteredMin(data[2].i16.xyz, 1);
\r
109 data[invocation].i16 = subgroupClusteredMin(data[3].i16, 1);
\r
111 data[invocation].i16.x = subgroupClusteredMax(data[0].i16.x, 1);
\r
112 data[invocation].i16.xy = subgroupClusteredMax(data[1].i16.xy, 1);
\r
113 data[invocation].i16.xyz = subgroupClusteredMax(data[2].i16.xyz, 1);
\r
114 data[invocation].i16 = subgroupClusteredMax(data[3].i16, 1);
\r
116 data[invocation].i16.x = subgroupClusteredAnd(data[0].i16.x, 1);
\r
117 data[invocation].i16.xy = subgroupClusteredAnd(data[1].i16.xy, 1);
\r
118 data[invocation].i16.xyz = subgroupClusteredAnd(data[2].i16.xyz, 1);
\r
119 data[invocation].i16 = subgroupClusteredAnd(data[3].i16, 1);
\r
121 data[invocation].i16.x = subgroupClusteredOr(data[0].i16.x, 1);
\r
122 data[invocation].i16.xy = subgroupClusteredOr(data[1].i16.xy, 1);
\r
123 data[invocation].i16.xyz = subgroupClusteredOr(data[2].i16.xyz, 1);
\r
124 data[invocation].i16 = subgroupClusteredOr(data[3].i16, 1);
\r
126 data[invocation].i16.x = subgroupClusteredXor(data[0].i16.x, 1);
\r
127 data[invocation].i16.xy = subgroupClusteredXor(data[1].i16.xy, 1);
\r
128 data[invocation].i16.xyz = subgroupClusteredXor(data[2].i16.xyz, 1);
\r
129 data[invocation].i16 = subgroupClusteredXor(data[3].i16, 1);
\r
131 data[invocation].u16.x = subgroupClusteredAdd(data[0].u16.x, 1);
\r
132 data[invocation].u16.xy = subgroupClusteredAdd(data[1].u16.xy, 1);
\r
133 data[invocation].u16.xyz = subgroupClusteredAdd(data[2].u16.xyz, 1);
\r
134 data[invocation].u16 = subgroupClusteredAdd(data[3].u16, 1);
\r
136 data[invocation].u16.x = subgroupClusteredMul(data[0].u16.x, 1);
\r
137 data[invocation].u16.xy = subgroupClusteredMul(data[1].u16.xy, 1);
\r
138 data[invocation].u16.xyz = subgroupClusteredMul(data[2].u16.xyz, 1);
\r
139 data[invocation].u16 = subgroupClusteredMul(data[3].u16, 1);
\r
141 data[invocation].u16.x = subgroupClusteredMin(data[0].u16.x, 1);
\r
142 data[invocation].u16.xy = subgroupClusteredMin(data[1].u16.xy, 1);
\r
143 data[invocation].u16.xyz = subgroupClusteredMin(data[2].u16.xyz, 1);
\r
144 data[invocation].u16 = subgroupClusteredMin(data[3].u16, 1);
\r
146 data[invocation].u16.x = subgroupClusteredMax(data[0].u16.x, 1);
\r
147 data[invocation].u16.xy = subgroupClusteredMax(data[1].u16.xy, 1);
\r
148 data[invocation].u16.xyz = subgroupClusteredMax(data[2].u16.xyz, 1);
\r
149 data[invocation].u16 = subgroupClusteredMax(data[3].u16, 1);
\r
151 data[invocation].u16.x = subgroupClusteredAnd(data[0].u16.x, 1);
\r
152 data[invocation].u16.xy = subgroupClusteredAnd(data[1].u16.xy, 1);
\r
153 data[invocation].u16.xyz = subgroupClusteredAnd(data[2].u16.xyz, 1);
\r
154 data[invocation].u16 = subgroupClusteredAnd(data[3].u16, 1);
\r
156 data[invocation].u16.x = subgroupClusteredOr(data[0].u16.x, 1);
\r
157 data[invocation].u16.xy = subgroupClusteredOr(data[1].u16.xy, 1);
\r
158 data[invocation].u16.xyz = subgroupClusteredOr(data[2].u16.xyz, 1);
\r
159 data[invocation].u16 = subgroupClusteredOr(data[3].u16, 1);
\r
161 data[invocation].u16.x = subgroupClusteredXor(data[0].u16.x, 1);
\r
162 data[invocation].u16.xy = subgroupClusteredXor(data[1].u16.xy, 1);
\r
163 data[invocation].u16.xyz = subgroupClusteredXor(data[2].u16.xyz, 1);
\r
164 data[invocation].u16 = subgroupClusteredXor(data[3].u16, 1);
\r
166 data[invocation].i64.x = subgroupClusteredAdd(data[0].i64.x, 1);
\r
167 data[invocation].i64.xy = subgroupClusteredAdd(data[1].i64.xy, 1);
\r
168 data[invocation].i64.xyz = subgroupClusteredAdd(data[2].i64.xyz, 1);
\r
169 data[invocation].i64 = subgroupClusteredAdd(data[3].i64, 1);
\r
171 data[invocation].i64.x = subgroupClusteredMul(data[0].i64.x, 1);
\r
172 data[invocation].i64.xy = subgroupClusteredMul(data[1].i64.xy, 1);
\r
173 data[invocation].i64.xyz = subgroupClusteredMul(data[2].i64.xyz, 1);
\r
174 data[invocation].i64 = subgroupClusteredMul(data[3].i64, 1);
\r
176 data[invocation].i64.x = subgroupClusteredMin(data[0].i64.x, 1);
\r
177 data[invocation].i64.xy = subgroupClusteredMin(data[1].i64.xy, 1);
\r
178 data[invocation].i64.xyz = subgroupClusteredMin(data[2].i64.xyz, 1);
\r
179 data[invocation].i64 = subgroupClusteredMin(data[3].i64, 1);
\r
181 data[invocation].i64.x = subgroupClusteredMax(data[0].i64.x, 1);
\r
182 data[invocation].i64.xy = subgroupClusteredMax(data[1].i64.xy, 1);
\r
183 data[invocation].i64.xyz = subgroupClusteredMax(data[2].i64.xyz, 1);
\r
184 data[invocation].i64 = subgroupClusteredMax(data[3].i64, 1);
\r
186 data[invocation].i64.x = subgroupClusteredAnd(data[0].i64.x, 1);
\r
187 data[invocation].i64.xy = subgroupClusteredAnd(data[1].i64.xy, 1);
\r
188 data[invocation].i64.xyz = subgroupClusteredAnd(data[2].i64.xyz, 1);
\r
189 data[invocation].i64 = subgroupClusteredAnd(data[3].i64, 1);
\r
191 data[invocation].i64.x = subgroupClusteredOr(data[0].i64.x, 1);
\r
192 data[invocation].i64.xy = subgroupClusteredOr(data[1].i64.xy, 1);
\r
193 data[invocation].i64.xyz = subgroupClusteredOr(data[2].i64.xyz, 1);
\r
194 data[invocation].i64 = subgroupClusteredOr(data[3].i64, 1);
\r
196 data[invocation].i64.x = subgroupClusteredXor(data[0].i64.x, 1);
\r
197 data[invocation].i64.xy = subgroupClusteredXor(data[1].i64.xy, 1);
\r
198 data[invocation].i64.xyz = subgroupClusteredXor(data[2].i64.xyz, 1);
\r
199 data[invocation].i64 = subgroupClusteredXor(data[3].i64, 1);
\r
201 data[invocation].u64.x = subgroupClusteredAdd(data[0].u64.x, 1);
\r
202 data[invocation].u64.xy = subgroupClusteredAdd(data[1].u64.xy, 1);
\r
203 data[invocation].u64.xyz = subgroupClusteredAdd(data[2].u64.xyz, 1);
\r
204 data[invocation].u64 = subgroupClusteredAdd(data[3].u64, 1);
\r
206 data[invocation].u64.x = subgroupClusteredMul(data[0].u64.x, 1);
\r
207 data[invocation].u64.xy = subgroupClusteredMul(data[1].u64.xy, 1);
\r
208 data[invocation].u64.xyz = subgroupClusteredMul(data[2].u64.xyz, 1);
\r
209 data[invocation].u64 = subgroupClusteredMul(data[3].u64, 1);
\r
211 data[invocation].u64.x = subgroupClusteredMin(data[0].u64.x, 1);
\r
212 data[invocation].u64.xy = subgroupClusteredMin(data[1].u64.xy, 1);
\r
213 data[invocation].u64.xyz = subgroupClusteredMin(data[2].u64.xyz, 1);
\r
214 data[invocation].u64 = subgroupClusteredMin(data[3].u64, 1);
\r
216 data[invocation].u64.x = subgroupClusteredMax(data[0].u64.x, 1);
\r
217 data[invocation].u64.xy = subgroupClusteredMax(data[1].u64.xy, 1);
\r
218 data[invocation].u64.xyz = subgroupClusteredMax(data[2].u64.xyz, 1);
\r
219 data[invocation].u64 = subgroupClusteredMax(data[3].u64, 1);
\r
221 data[invocation].u64.x = subgroupClusteredAnd(data[0].u64.x, 1);
\r
222 data[invocation].u64.xy = subgroupClusteredAnd(data[1].u64.xy, 1);
\r
223 data[invocation].u64.xyz = subgroupClusteredAnd(data[2].u64.xyz, 1);
\r
224 data[invocation].u64 = subgroupClusteredAnd(data[3].u64, 1);
\r
226 data[invocation].u64.x = subgroupClusteredOr(data[0].u64.x, 1);
\r
227 data[invocation].u64.xy = subgroupClusteredOr(data[1].u64.xy, 1);
\r
228 data[invocation].u64.xyz = subgroupClusteredOr(data[2].u64.xyz, 1);
\r
229 data[invocation].u64 = subgroupClusteredOr(data[3].u64, 1);
\r
231 data[invocation].u64.x = subgroupClusteredXor(data[0].u64.x, 1);
\r
232 data[invocation].u64.xy = subgroupClusteredXor(data[1].u64.xy, 1);
\r
233 data[invocation].u64.xyz = subgroupClusteredXor(data[2].u64.xyz, 1);
\r
234 data[invocation].u64 = subgroupClusteredXor(data[3].u64, 1);
\r
236 data[invocation].f16.x = subgroupClusteredAdd(data[0].f16.x, 1);
\r
237 data[invocation].f16.xy = subgroupClusteredAdd(data[1].f16.xy, 1);
\r
238 data[invocation].f16.xyz = subgroupClusteredAdd(data[2].f16.xyz, 1);
\r
239 data[invocation].f16 = subgroupClusteredAdd(data[3].f16, 1);
\r
241 data[invocation].f16.x = subgroupClusteredMul(data[0].f16.x, 1);
\r
242 data[invocation].f16.xy = subgroupClusteredMul(data[1].f16.xy, 1);
\r
243 data[invocation].f16.xyz = subgroupClusteredMul(data[2].f16.xyz, 1);
\r
244 data[invocation].f16 = subgroupClusteredMul(data[3].f16, 1);
\r
246 data[invocation].f16.x = subgroupClusteredMin(data[0].f16.x, 1);
\r
247 data[invocation].f16.xy = subgroupClusteredMin(data[1].f16.xy, 1);
\r
248 data[invocation].f16.xyz = subgroupClusteredMin(data[2].f16.xyz, 1);
\r
249 data[invocation].f16 = subgroupClusteredMin(data[3].f16, 1);
\r
251 data[invocation].f16.x = subgroupClusteredMax(data[0].f16.x, 1);
\r
252 data[invocation].f16.xy = subgroupClusteredMax(data[1].f16.xy, 1);
\r
253 data[invocation].f16.xyz = subgroupClusteredMax(data[2].f16.xyz, 1);
\r
254 data[invocation].f16 = subgroupClusteredMax(data[3].f16, 1);
\r