3 vec4 undeclared_errors(vec4 f4)
\r
6 gl_SubgroupSize; // ERROR, extension not enabled (basic)
\r
7 gl_SubgroupInvocationID; // ERROR, extension not enabled (basic)
\r
8 subgroupBarrier(); // ERROR, extension not enabled (basic)
\r
9 subgroupMemoryBarrier(); // ERROR, extension not enabled (basic)
\r
10 subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic)
\r
11 subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic)
\r
12 subgroupElect(); // ERROR, extension not enabled (basic)
\r
13 gl_NumSubgroups; // ERROR, extension not enabled (basic)
\r
14 gl_SubgroupID; // ERROR, extension not enabled (basic)
\r
15 subgroupMemoryBarrierShared(); // ERROR, extension not enabled (basic)
\r
17 subgroupAll(true); // ERROR extension not enabled (vote)
\r
18 subgroupAny(false); // ERROR extension not enabled (vote)
\r
19 subgroupAllEqual(f4); // ERROR extension not enabled (vote)
\r
21 gl_SubgroupEqMask; // ERROR extension not enabled (ballot)
\r
22 gl_SubgroupGeMask; // ERROR extension not enabled (ballot)
\r
23 gl_SubgroupGtMask; // ERROR extension not enabled (ballot)
\r
24 gl_SubgroupLeMask; // ERROR extension not enabled (ballot)
\r
25 gl_SubgroupLtMask; // ERROR extension not enabled (ballot)
\r
26 subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot)
\r
27 subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot)
\r
28 uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot)
\r
29 subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot)
\r
30 subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot)
\r
31 subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot)
\r
32 subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot)
\r
33 subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot)
\r
34 subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot)
\r
35 subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot)
\r
37 subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle)
\r
38 subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle)
\r
39 subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative)
\r
40 subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative)
\r
42 result = subgroupAdd(f4); // ERROR, extension not enabled (arith)
\r
43 subgroupMul(f4); // ERROR, extension not enabled (arith)
\r
44 subgroupMin(f4); // ERROR, extension not enabled (arith)
\r
45 subgroupMax(f4); // ERROR, extension not enabled (arith)
\r
46 subgroupAnd(ballot); // ERROR, extension not enabled (arith)
\r
47 subgroupOr(ballot); // ERROR, extension not enabled (arith)
\r
48 subgroupXor(ballot); // ERROR, extension not enabled (arith)
\r
49 subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith)
\r
50 subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith)
\r
51 subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith)
\r
52 subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith)
\r
53 subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith)
\r
54 subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith)
\r
55 subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith)
\r
56 subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith)
\r
57 subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith)
\r
58 subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith)
\r
59 subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith)
\r
60 subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith)
\r
61 subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith)
\r
62 subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith)
\r
64 subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered)
\r
65 subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered)
\r
66 subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered)
\r
67 subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered)
\r
68 subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered)
\r
69 subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered)
\r
70 subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered)
\r
72 subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad)
\r
73 subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad)
\r
74 subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad)
\r
75 subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad)
\r
77 uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned)
\r
78 subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
79 subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
80 subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
81 subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
82 subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
83 subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
84 subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
85 subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
86 subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
87 subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
88 subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
89 subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
90 subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
91 subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
92 subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
93 subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
94 subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
95 subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
\r
96 subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
97 subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
98 subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
\r
103 #extension GL_KHR_shader_subgroup_basic: enable
\r
105 layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
\r
107 layout(binding = 0) buffer Buffer
\r
114 data.a[gl_SubgroupSize] = 1;
\r
115 data.a[gl_SubgroupInvocationID] = 1;
\r
116 data.a[gl_NumSubgroups] = 1;
\r
117 data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0;
\r
119 subgroupMemoryBarrier();
\r
120 subgroupMemoryBarrierBuffer();
\r
121 subgroupMemoryBarrierShared();
\r
122 subgroupMemoryBarrierImage();
\r
125 #extension GL_KHR_shader_subgroup_ballot: enable
\r
126 void ballot_works(vec4 f4) {
\r
132 subgroupBroadcast(f4, 0);
\r
133 subgroupBroadcastFirst(f4);
\r
134 uvec4 ballot = subgroupBallot(false);
\r
135 subgroupInverseBallot(uvec4(0x1));
\r
136 subgroupBallotBitExtract(ballot, 0);
\r
137 subgroupBallotBitCount(ballot);
\r
138 subgroupBallotInclusiveBitCount(ballot);
\r
139 subgroupBallotExclusiveBitCount(ballot);
\r
140 subgroupBallotFindLSB(ballot);
\r
141 subgroupBallotFindMSB(ballot);
\r
144 #extension GL_KHR_shader_subgroup_vote: enable
\r
145 void vote_works(vec4 f4)
\r
148 subgroupAny(false);
\r
149 subgroupAllEqual(f4);
\r
152 #extension GL_KHR_shader_subgroup_shuffle: enable
\r
153 #extension GL_KHR_shader_subgroup_shuffle_relative: enable
\r
154 void shuffle_works(vec4 f4)
\r
156 subgroupShuffle(f4, 0);
\r
157 subgroupShuffleXor(f4, 0x1);
\r
158 subgroupShuffleUp(f4, 1);
\r
159 subgroupShuffleDown(f4, 1);
\r
162 #extension GL_KHR_shader_subgroup_arithmetic: enable
\r
163 void arith_works(vec4 f4)
\r
170 subgroupAnd(ballot);
\r
171 subgroupOr(ballot);
\r
172 subgroupXor(ballot);
\r
173 subgroupInclusiveAdd(f4);
\r
174 subgroupInclusiveMul(f4);
\r
175 subgroupInclusiveMin(f4);
\r
176 subgroupInclusiveMax(f4);
\r
177 subgroupInclusiveAnd(ballot);
\r
178 subgroupInclusiveOr(ballot);
\r
179 subgroupInclusiveXor(ballot);
\r
180 subgroupExclusiveAdd(f4);
\r
181 subgroupExclusiveMul(f4);
\r
182 subgroupExclusiveMin(f4);
\r
183 subgroupExclusiveMax(f4);
\r
184 subgroupExclusiveAnd(ballot);
\r
185 subgroupExclusiveOr(ballot);
\r
186 subgroupExclusiveXor(ballot);
\r
189 #extension GL_KHR_shader_subgroup_clustered: enable
\r
190 void clustered_works(vec4 f4)
\r
192 uvec4 ballot = uvec4(0x55,0,0,0);
\r
193 subgroupClusteredAdd(f4, 2);
\r
194 subgroupClusteredMul(f4, 2);
\r
195 subgroupClusteredMin(f4, 2);
\r
196 subgroupClusteredMax(f4, 2);
\r
197 subgroupClusteredAnd(ballot, 2);
\r
198 subgroupClusteredOr(ballot, 2);
\r
199 subgroupClusteredXor(ballot, 2);
\r
202 #extension GL_KHR_shader_subgroup_quad: enable
\r
203 void quad_works(vec4 f4)
\r
205 subgroupQuadBroadcast(f4, 0);
\r
206 subgroupQuadSwapHorizontal(f4);
\r
207 subgroupQuadSwapVertical(f4);
\r
208 subgroupQuadSwapDiagonal(f4);
\r
211 #extension GL_NV_shader_subgroup_partitioned: enable
\r
212 void partitioned_works(vec4 f4)
\r
214 uvec4 parti = subgroupPartitionNV(f4);
\r
215 uvec4 ballot = uvec4(0x55,0,0,0);
\r
216 subgroupPartitionedAddNV(f4, parti);
\r
217 subgroupPartitionedMulNV(f4, parti);
\r
218 subgroupPartitionedMinNV(f4, parti);
\r
219 subgroupPartitionedMaxNV(f4, parti);
\r
220 subgroupPartitionedAndNV(ballot, parti);
\r
221 subgroupPartitionedOrNV(ballot, parti);
\r
222 subgroupPartitionedXorNV(ballot, parti);
\r
223 subgroupPartitionedInclusiveAddNV(f4, parti);
\r
224 subgroupPartitionedInclusiveMulNV(f4, parti);
\r
225 subgroupPartitionedInclusiveMinNV(f4, parti);
\r
226 subgroupPartitionedInclusiveMaxNV(f4, parti);
\r
227 subgroupPartitionedInclusiveAndNV(ballot, parti);
\r
228 subgroupPartitionedInclusiveOrNV(ballot, parti);
\r
229 subgroupPartitionedInclusiveXorNV(ballot, parti);
\r
230 subgroupPartitionedExclusiveAddNV(f4, parti);
\r
231 subgroupPartitionedExclusiveMulNV(f4, parti);
\r
232 subgroupPartitionedExclusiveMinNV(f4, parti);
\r
233 subgroupPartitionedExclusiveMaxNV(f4, parti);
\r
234 subgroupPartitionedExclusiveAndNV(ballot, parti);
\r
235 subgroupPartitionedExclusiveOrNV(ballot, parti);
\r
236 subgroupPartitionedExclusiveXorNV(ballot, parti);
\r
239 // tests for NV_shader_sm_builtins
\r
240 void sm_builtins_err()
\r
242 gl_WarpsPerSMNV; // ERROR, no extension
\r
243 gl_SMCountNV; // ERROR, no extension
\r
244 gl_WarpIDNV; // ERROR, no extension
\r
245 gl_SMIDNV; // ERROR, no extension
\r
248 #ifdef GL_NV_shader_sm_builtins
\r
249 #extension GL_NV_shader_sm_builtins : enable
\r