2 #extension GL_NV_ray_tracing : enable
4 vec4 undeclared_errors(vec4 f4)
7 gl_SubgroupSize; // ERROR, extension not enabled (basic)
8 gl_SubgroupInvocationID; // ERROR, extension not enabled (basic)
9 subgroupBarrier(); // ERROR, extension not enabled (basic)
10 subgroupMemoryBarrier(); // ERROR, extension not enabled (basic)
11 subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic)
12 subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic)
13 subgroupElect(); // ERROR, extension not enabled (basic)
14 gl_NumSubgroups; // ERROR, only defined in compute
15 gl_SubgroupID; // ERROR, only defined in compute
16 subgroupMemoryBarrierShared(); // ERROR, only defined in compute
18 subgroupAll(true); // ERROR extension not enabled (vote)
19 subgroupAny(false); // ERROR extension not enabled (vote)
20 subgroupAllEqual(f4); // ERROR extension not enabled (vote)
22 gl_SubgroupEqMask; // ERROR extension not enabled (ballot)
23 gl_SubgroupGeMask; // ERROR extension not enabled (ballot)
24 gl_SubgroupGtMask; // ERROR extension not enabled (ballot)
25 gl_SubgroupLeMask; // ERROR extension not enabled (ballot)
26 gl_SubgroupLtMask; // ERROR extension not enabled (ballot)
27 subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot)
28 subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot)
29 uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot)
30 subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot)
31 subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot)
32 subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot)
33 subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot)
34 subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot)
35 subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot)
36 subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot)
38 subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle)
39 subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle)
40 subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative)
41 subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative)
43 result = subgroupAdd(f4); // ERROR, extension not enabled (arith)
44 subgroupMul(f4); // ERROR, extension not enabled (arith)
45 subgroupMin(f4); // ERROR, extension not enabled (arith)
46 subgroupMax(f4); // ERROR, extension not enabled (arith)
47 subgroupAnd(ballot); // ERROR, extension not enabled (arith)
48 subgroupOr(ballot); // ERROR, extension not enabled (arith)
49 subgroupXor(ballot); // ERROR, extension not enabled (arith)
50 subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith)
51 subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith)
52 subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith)
53 subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith)
54 subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith)
55 subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith)
56 subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith)
57 subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith)
58 subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith)
59 subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith)
60 subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith)
61 subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith)
62 subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith)
63 subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith)
65 subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered)
66 subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered)
67 subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered)
68 subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered)
69 subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered)
70 subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered)
71 subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered)
73 subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad)
74 subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad)
75 subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad)
76 subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad)
78 uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned)
79 subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
80 subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
81 subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
82 subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
83 subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
84 subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
85 subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
86 subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
87 subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
88 subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
89 subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
90 subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
91 subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
92 subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
93 subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned)
94 subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned)
95 subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned)
96 subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned)
97 subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned)
98 subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned)
99 subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned)
105 layout(location = 0) callableDataNV vec4 data0;
106 layout(location = 1) callableDataInNV dataBlock {
111 uvec3 id = gl_LaunchIDNV;
112 uvec3 size = gl_LaunchSizeNV;
114 executeCallableNV(2,1);
118 #extension GL_KHR_shader_subgroup_basic: enable
119 void basic_works (void)
122 gl_SubgroupInvocationID;
124 subgroupMemoryBarrier();
125 subgroupMemoryBarrierBuffer();
126 subgroupMemoryBarrierImage();
130 #extension GL_KHR_shader_subgroup_ballot: enable
131 void ballot_works(vec4 f4) {
137 subgroupBroadcast(f4, 0);
138 subgroupBroadcastFirst(f4);
139 uvec4 ballot = subgroupBallot(false);
140 subgroupInverseBallot(uvec4(0x1));
141 subgroupBallotBitExtract(ballot, 0);
142 subgroupBallotBitCount(ballot);
143 subgroupBallotInclusiveBitCount(ballot);
144 subgroupBallotExclusiveBitCount(ballot);
145 subgroupBallotFindLSB(ballot);
146 subgroupBallotFindMSB(ballot);
149 #extension GL_KHR_shader_subgroup_vote: enable
150 void vote_works(vec4 f4)
154 subgroupAllEqual(f4);
157 #extension GL_KHR_shader_subgroup_shuffle: enable
158 #extension GL_KHR_shader_subgroup_shuffle_relative: enable
159 void shuffle_works(vec4 f4)
161 subgroupShuffle(f4, 0);
162 subgroupShuffleXor(f4, 0x1);
163 subgroupShuffleUp(f4, 1);
164 subgroupShuffleDown(f4, 1);
167 #extension GL_KHR_shader_subgroup_arithmetic: enable
168 void arith_works(vec4 f4)
178 subgroupInclusiveAdd(f4);
179 subgroupInclusiveMul(f4);
180 subgroupInclusiveMin(f4);
181 subgroupInclusiveMax(f4);
182 subgroupInclusiveAnd(ballot);
183 subgroupInclusiveOr(ballot);
184 subgroupInclusiveXor(ballot);
185 subgroupExclusiveAdd(f4);
186 subgroupExclusiveMul(f4);
187 subgroupExclusiveMin(f4);
188 subgroupExclusiveMax(f4);
189 subgroupExclusiveAnd(ballot);
190 subgroupExclusiveOr(ballot);
191 subgroupExclusiveXor(ballot);
194 #extension GL_KHR_shader_subgroup_clustered: enable
195 void clustered_works(vec4 f4)
197 uvec4 ballot = uvec4(0x55,0,0,0);
198 subgroupClusteredAdd(f4, 2);
199 subgroupClusteredMul(f4, 2);
200 subgroupClusteredMin(f4, 2);
201 subgroupClusteredMax(f4, 2);
202 subgroupClusteredAnd(ballot, 2);
203 subgroupClusteredOr(ballot, 2);
204 subgroupClusteredXor(ballot, 2);
207 #extension GL_KHR_shader_subgroup_quad: enable
208 void quad_works(vec4 f4)
210 subgroupQuadBroadcast(f4, 0);
211 subgroupQuadSwapHorizontal(f4);
212 subgroupQuadSwapVertical(f4);
213 subgroupQuadSwapDiagonal(f4);
216 #extension GL_NV_shader_subgroup_partitioned: enable
217 void partitioned_works(vec4 f4)
219 uvec4 parti = subgroupPartitionNV(f4);
220 uvec4 ballot = uvec4(0x55,0,0,0);
221 subgroupPartitionedAddNV(f4, parti);
222 subgroupPartitionedMulNV(f4, parti);
223 subgroupPartitionedMinNV(f4, parti);
224 subgroupPartitionedMaxNV(f4, parti);
225 subgroupPartitionedAndNV(ballot, parti);
226 subgroupPartitionedOrNV(ballot, parti);
227 subgroupPartitionedXorNV(ballot, parti);
228 subgroupPartitionedInclusiveAddNV(f4, parti);
229 subgroupPartitionedInclusiveMulNV(f4, parti);
230 subgroupPartitionedInclusiveMinNV(f4, parti);
231 subgroupPartitionedInclusiveMaxNV(f4, parti);
232 subgroupPartitionedInclusiveAndNV(ballot, parti);
233 subgroupPartitionedInclusiveOrNV(ballot, parti);
234 subgroupPartitionedInclusiveXorNV(ballot, parti);
235 subgroupPartitionedExclusiveAddNV(f4, parti);
236 subgroupPartitionedExclusiveMulNV(f4, parti);
237 subgroupPartitionedExclusiveMinNV(f4, parti);
238 subgroupPartitionedExclusiveMaxNV(f4, parti);
239 subgroupPartitionedExclusiveAndNV(ballot, parti);
240 subgroupPartitionedExclusiveOrNV(ballot, parti);
241 subgroupPartitionedExclusiveXorNV(ballot, parti);
244 // tests for NV_shader_sm_builtins
245 void sm_builtins_err()
247 gl_WarpsPerSMNV; // ERROR, no extension
248 gl_SMCountNV; // ERROR, no extension
249 gl_WarpIDNV; // ERROR, no extension
250 gl_SMIDNV; // ERROR, no extension
253 #ifdef GL_NV_shader_sm_builtins
254 #extension GL_NV_shader_sm_builtins : enable