1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
|
//TEST:SIMPLE(filecheck=CHECK_GLSL): -allow-glsl -stage compute -entry computeMain -target glsl
//TEST:SIMPLE(filecheck=CHECK_SPV): -allow-glsl -stage compute -entry computeMain -target spirv -emit-spirv-directly
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl
//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl -emit-spirv-directly
// As per vulkan specification: https://registry.khronos.org/vulkan/specs/1.3/html/chap34.html#formats-definition
// i64/u64 images do not require sampled image support; support is currently unlikley on hardware
//#define test_when_hardware_supports_i64_and_u64_sampled_textures
// i64/u64 images do not require texel buffers support; support is currently unlikley on hardware
//#define TEST_when_hardware_supports_i64_and_u64_buffers
//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
buffer MyBlockName2
{
uint data[1];
} outputBuffer;
layout(local_size_x = 1) in;
//TEST_INPUT: set image_1d = RWTexture1D(format=R64Sint, size=4, content=one, mipMaps = 1)
uniform layout(binding=0,r64i) i64image1D image_1d;
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
//COM:TEST_INPUT: set image_buffer = RWTextureBuffer(format=R64Sint, stride=8, data=[0 1 0 1 0 1 0 1])
uniform layout(binding=1,r64i) i64imageBuffer image_buffer;
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
//TEST_INPUT: set image_1dArray = RWTexture1D(format=R64Sint, size=4, content=one, mipMaps = 1, arrayLength=2)
uniform layout(binding=2,r64i) i64image1DArray image_1dArray;
//TEST_INPUT: set image_2d = RWTexture2D(format=R64Sint, size=4, content=one, mipMaps = 1)
uniform layout(binding=3,r64i) i64image2D image_2d;
//TEST_INPUT: set image_2dRect = RWTexture2D(format=R64Sint, size=4, content=one, mipMaps = 1)
uniform layout(binding=4,r64i) i64image2DRect image_2dRect;
//TEST_INPUT: set image_2dArray = RWTexture2D(format=R64Sint, size=4, content=one, mipMaps = 1, arrayLength=2)
uniform layout(binding=6,r64i) i64image2DArray image_2dArray;
//TEST_INPUT: set image_3d = RWTexture3D(format=R64Sint, size=4, content=one, mipMaps = 1)
uniform layout(binding=7,r64i) i64image3D image_3d;
//TEST_INPUT: set image_cube = RWTextureCube(format=R64Sint, size=4, content=one, mipMaps = 1)
uniform layout(binding=8,r64i) i64imageCube image_cube;
//TEST_INPUT: set image_cubeArray = RWTextureCube(format=R64Sint, size=4, content=one, mipMaps = 1, arrayLength=2)
uniform layout(binding=9,r64i) i64imageCubeArray image_cubeArray;
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
//COM:TEST_INPUT: set image_2dMultiSample = RWTexture2D(format=R64Sint, size=4, content=one, mipMaps = 1, sampleCount = two)
uniform layout(binding=5,r64i) i64image2DMS image_2dMultiSample;
//COM:TEST_INPUT: set image_2dMultiSampleArray = RWTexture2D(format=R64Sint, size=4, content=one, mipMaps = 1, arrayLength=2, sampleCount = two)
uniform layout(binding=10,r64i) i64image2DMSArray image_2dMultiSampleArray;
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
bool checkAllImageSize()
{
return true
&& imageSize(image_1d) == int(4)
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageSize(image_buffer) == int(4)
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageSize(image_1dArray) == ivec2(4, 2)
&& imageSize(image_2d) == ivec2(4)
&& imageSize(image_2dArray) == ivec3(4, 4, 2)
&& imageSize(image_2dRect) == ivec2(4)
&& imageSize(image_3d) == ivec3(4)
&& imageSize(image_cube) == ivec2(4)
&& imageSize(image_cubeArray) == ivec3(4, 4, 2)
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageSize(image_2dMultiSample) == ivec2(4)
&& imageSize(image_2dMultiSampleArray) == ivec3(4, 4, 2)
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageLoad()
{
return true
&& imageLoad(image_1d, 0).x == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageLoad(image_buffer, 0).x == 1
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageLoad(image_1dArray, ivec2(0)).x == 1
&& imageLoad(image_2d, ivec2(0)).x == 1
&& imageLoad(image_2dRect, ivec2(0)).x == 1
&& imageLoad(image_2dArray, ivec3(0)).x == 1
&& imageLoad(image_3d, ivec3(0)).x == 1
&& imageLoad(image_cube, ivec3(0)).x == 1
&& imageLoad(image_cubeArray, ivec3(0)).x == 1
&& imageLoad(image_cubeArray, ivec3(0)).x == 1
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageLoad(image_2dMultiSample, ivec2(0), 1).x == 1
&& imageLoad(image_2dMultiSampleArray, ivec3(0), 1).x == 1
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool resetAllImageValues()
{
imageStore(image_1d, 0,i64vec4(1));
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
imageStore(image_buffer, 0,i64vec4(1));
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
imageStore(image_1dArray, ivec2(0),i64vec4(1));
imageStore(image_2d, ivec2(0),i64vec4(1));
imageStore(image_2dRect, ivec2(0),i64vec4(1));
imageStore(image_2dArray, ivec3(0),i64vec4(1));
imageStore(image_3d, ivec3(0),i64vec4(1));
imageStore(image_cube, ivec3(0),i64vec4(1));
imageStore(image_cubeArray, ivec3(0),i64vec4(1));
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
imageStore(image_2dMultiSample, ivec2(0), 1, i64vec4(1));
imageStore(image_2dMultiSampleArray, ivec3(0), 1,i64vec4(1));
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
return true;
}
int64_t load_image_1d()
{
return imageLoad(image_1d, 0).x;
}
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
int64_t load_image_buffer()
{
return imageLoad(image_buffer, 0).x;
}
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
int64_t load_image_1dArray()
{
return imageLoad(image_1dArray, ivec2(0)).x;
}
int64_t load_image_2d()
{
return imageLoad(image_2d, ivec2(0)).x;
}
int64_t load_image_2dRect()
{
return imageLoad(image_2dRect, ivec2(0)).x;
}
int64_t load_image_2dArray()
{
return imageLoad(image_2dArray, ivec3(0)).x;
}
int64_t load_image_3d()
{
return imageLoad(image_3d, ivec3(0)).x;
}
int64_t load_image_cube()
{
return imageLoad(image_cube, ivec3(0)).x;
}
int64_t load_image_cubeArray()
{
return imageLoad(image_cubeArray, ivec3(0)).x;
}
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
int64_t load_image_2dMultiSample()
{
return imageLoad(image_2dMultiSample, ivec2(0), 1).x;
}
int64_t load_image_2dMultiSampleArray()
{
return imageLoad(image_2dMultiSampleArray, ivec3(0), 1).x;
}
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
// requires ImageLoad test to pass
bool checkAllImageStore()
{
bool loadCheck = true;
imageStore(image_1d, 0,i64vec4(0));
loadCheck = loadCheck && load_image_1d() == 0;
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
imageStore(image_buffer, 0,i64vec4(0));
loadCheck = loadCheck && load_image_buffer() == 0;
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
imageStore(image_1dArray, ivec2(0),i64vec4(0));
loadCheck = loadCheck && load_image_1dArray() == 0;
imageStore(image_2d, ivec2(0),i64vec4(0));
loadCheck = loadCheck && load_image_2d() == 0;
imageStore(image_2dRect, ivec2(0),i64vec4(0));
loadCheck = loadCheck && load_image_2dRect() == 0;
imageStore(image_2dArray, ivec3(0),i64vec4(0));
loadCheck = loadCheck && load_image_2dArray() == 0;
imageStore(image_3d, ivec3(0),i64vec4(0));
loadCheck = loadCheck && load_image_3d() == 0;
imageStore(image_cube, ivec3(0),i64vec4(0));
loadCheck = loadCheck && load_image_cube() == 0;
imageStore(image_cubeArray, ivec3(0),i64vec4(0));
loadCheck = loadCheck && load_image_cubeArray() == 0;
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
imageStore(image_2dMultiSample, ivec2(0), 1, i64vec4(0));
loadCheck = loadCheck && load_image_2dMultiSample() == 0;
imageStore(image_2dMultiSampleArray, ivec3(0), 1,i64vec4(0));
loadCheck = loadCheck && load_image_2dMultiSampleArray() == 0;
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
resetAllImageValues();
return loadCheck;
}
bool checkAllImageSamples()
{
resetAllImageValues();
return true
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageSamples(image_2dMultiSample) == 2
&& imageSamples(image_2dMultiSampleArray) == 2
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicAdd()
{
resetAllImageValues();
return true
&& imageAtomicAdd(image_1d, 0, 0) == 1
&& load_image_1d() == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicAdd(image_buffer, 0, 2) == 1
&& load_image_buffer() == 3
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicAdd(image_1dArray, ivec2(0), 0) == 1
&& load_image_1dArray() == 1
&& imageAtomicAdd(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 3
&& imageAtomicAdd(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 3
&& imageAtomicAdd(image_2dArray, ivec3(0), 0) == 1
&& load_image_2dArray() == 1
&& imageAtomicAdd(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 3
&& imageAtomicAdd(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 3
&& imageAtomicAdd(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 3
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicAdd(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 3
&& imageAtomicAdd(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 3
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicExchange()
{
resetAllImageValues();
return true
&& imageAtomicExchange(image_1d, 0, 0) == 1
&& load_image_1d() == 0
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicExchange(image_buffer, 0, 2) == 1
&& load_image_buffer() == 2
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicExchange(image_1dArray, ivec2(0), 0) == 1
&& load_image_1dArray() == 0
&& imageAtomicExchange(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 2
&& imageAtomicExchange(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 2
&& imageAtomicExchange(image_2dArray, ivec3(0), 0) == 1
&& load_image_2dArray() == 0
&& imageAtomicExchange(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 2
&& imageAtomicExchange(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 2
&& imageAtomicExchange(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 2
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicExchange(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 2
&& imageAtomicExchange(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 2
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicMin()
{
resetAllImageValues();
return true
&& imageAtomicMin(image_1d, 0, 0) == 1
&& load_image_1d() == 0
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicMin(image_buffer, 0, 2) == 1
&& load_image_buffer() == 1
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicMin(image_1dArray, ivec2(0), 0) == 1
&& load_image_1dArray() == 0
&& imageAtomicMin(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 1
&& imageAtomicMin(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 1
&& imageAtomicMin(image_2dArray, ivec3(0), 0) == 1
&& load_image_2dArray() == 0
&& imageAtomicMin(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 1
&& imageAtomicMin(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 1
&& imageAtomicMin(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 1
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicMin(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 1
&& imageAtomicMin(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 1
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicMax()
{
resetAllImageValues();
return true
&& imageAtomicMax(image_1d, 0, 0) == 1
&& load_image_1d() == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicMax(image_buffer, 0, 2) == 1
&& load_image_buffer() == 2
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicMax(image_1dArray, ivec2(0), 0) == 1
&& load_image_1dArray() == 1
&& imageAtomicMax(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 2
&& imageAtomicMax(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 2
&& imageAtomicMax(image_2dArray, ivec3(0), 0) == 1
&& load_image_2dArray() == 1
&& imageAtomicMax(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 2
&& imageAtomicMax(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 2
&& imageAtomicMax(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 2
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicMax(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 2
&& imageAtomicMax(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 2
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicAnd()
{
resetAllImageValues();
return true
&& imageAtomicAnd(image_1d, 0, 1) == 1
&& load_image_1d() == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicAnd(image_buffer, 0, 2) == 1
&& load_image_buffer() == 0
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicAnd(image_1dArray, ivec2(0), 1) == 1
&& load_image_1dArray() == 1
&& imageAtomicAnd(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 0
&& imageAtomicAnd(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 0
&& imageAtomicAnd(image_2dArray, ivec3(0), 1) == 1
&& load_image_2dArray() == 1
&& imageAtomicAnd(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 0
&& imageAtomicAnd(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 0
&& imageAtomicAnd(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 0
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicAnd(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 0
&& imageAtomicAnd(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 0
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicOr()
{
resetAllImageValues();
return true
&& imageAtomicOr(image_1d, 0, 1) == 1
&& load_image_1d() == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicOr(image_buffer, 0, 2) == 1
&& load_image_buffer() == 3
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicOr(image_1dArray, ivec2(0), 1) == 1
&& load_image_1dArray() == 1
&& imageAtomicOr(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 3
&& imageAtomicOr(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 3
&& imageAtomicOr(image_2dArray, ivec3(0), 1) == 1
&& load_image_2dArray() == 1
&& imageAtomicOr(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 3
&& imageAtomicOr(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 3
&& imageAtomicOr(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 3
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicOr(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 3
&& imageAtomicOr(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 3
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicXor()
{
resetAllImageValues();
return true
&& imageAtomicXor(image_1d, 0, 1) == 1
&& load_image_1d() == 0
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicXor(image_buffer, 0, 2) == 1
&& load_image_buffer() == 3
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicXor(image_1dArray, ivec2(0), 1) == 1
&& load_image_1dArray() == 0
&& imageAtomicXor(image_2d, ivec2(0), 2) == 1
&& load_image_2d() == 3
&& imageAtomicXor(image_2dRect, ivec2(0), 2) == 1
&& load_image_2dRect() == 3
&& imageAtomicXor(image_2dArray, ivec3(0), 1) == 1
&& load_image_2dArray() == 0
&& imageAtomicXor(image_3d, ivec3(0), 2) == 1
&& load_image_3d() == 3
&& imageAtomicXor(image_cube, ivec3(0), 2) == 1
&& load_image_cube() == 3
&& imageAtomicXor(image_cubeArray, ivec3(0), 2) == 1
&& load_image_cubeArray() == 3
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicXor(image_2dMultiSample, ivec2(0), 1, 2) == 1
&& load_image_2dMultiSample() == 3
&& imageAtomicXor(image_2dMultiSampleArray, ivec3(0), 1, 2) == 1
&& load_image_2dMultiSampleArray() == 3
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
bool checkAllImageAtomicCompSwap()
{
resetAllImageValues();
return true
&& imageAtomicCompSwap(image_1d, 0, 0, 2) == 1
&& load_image_1d() == 1
#ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicCompSwap(image_buffer, 0, 1, 2) == 1
&& load_image_buffer() == 2
#endif // #ifdef TEST_when_hardware_supports_i64_and_u64_buffers
&& imageAtomicCompSwap(image_1dArray, ivec2(0), 0, 2) == 1
&& load_image_1dArray() == 1
&& imageAtomicCompSwap(image_2d, ivec2(0), 1, 2) == 1
&& load_image_2d() == 2
&& imageAtomicCompSwap(image_2dRect, ivec2(0), 1, 2) == 1
&& load_image_2dRect() == 2
&& imageAtomicCompSwap(image_2dArray, ivec3(0), 0, 2) == 1
&& load_image_2dArray() == 1
&& imageAtomicCompSwap(image_3d, ivec3(0), 1, 2) == 1
&& load_image_3d() == 2
&& imageAtomicCompSwap(image_cube, ivec3(0), 1, 2) == 1
&& load_image_cube() == 2
&& imageAtomicCompSwap(image_cubeArray, ivec3(0), 1, 2) == 1
&& load_image_cubeArray() == 2
#ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
&& imageAtomicCompSwap(image_2dMultiSample, ivec2(0), 1, 1, 2) == 1
&& load_image_2dMultiSample() == 2
&& imageAtomicCompSwap(image_2dMultiSampleArray, ivec3(0), 1, 1, 2) == 1
&& load_image_2dMultiSampleArray() == 2
#endif // #ifdef test_when_hardware_supports_i64_and_u64_sampled_textures
;
}
// CHECK_GLSL: void main(
// CHECK_SPV: OpEntryPoint
void computeMain()
{
outputBuffer.data[0] = true
&& checkAllImageSize()
&& checkAllImageLoad()
&& checkAllImageStore()
&& checkAllImageSamples()
&& checkAllImageAtomicAdd()
&& checkAllImageAtomicExchange()
&& checkAllImageAtomicMin()
&& checkAllImageAtomicMax()
&& checkAllImageAtomicAnd()
&& checkAllImageAtomicOr()
&& checkAllImageAtomicXor()
&& checkAllImageAtomicCompSwap()
;
// BUF: 1
}
|