yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Simon Kallweitupdate slang-rhi (#6587)ae1a5e408

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