1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
5 * Copyright (c) 2020 Valve Corporation.
6 * Copyright (c) 2020 The Khronos Group Inc.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * \brief Helper SPIR-V shaders for some image atomic operations.
23 *//*--------------------------------------------------------------------*/
25 #include "vktImageAtomicSpirvShaders.hpp"
38 const std::string kShader_1d_r32ui_end_result = R"(
39 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
40 ; replaced with a template parameter and the last argument for it has been made optional.
43 ; precision highp uimage1D;
45 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
46 ; layout (r32ui, binding=0) coherent uniform uimage1D u_resultImage;
50 ; int gx = int(gl_GlobalInvocationID.x);
51 ; int gy = int(gl_GlobalInvocationID.y);
52 ; int gz = int(gl_GlobalInvocationID.z);
53 ; imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz));
58 ; Generator: Khronos Glslang Reference Front End; 7
63 %1 = OpExtInstImport "GLSL.std.450"
64 OpMemoryModel Logical GLSL450
65 OpEntryPoint GLCompute %4 "main" %12
66 OpExecutionMode %4 LocalSize 1 1 1
67 OpDecorate %12 BuiltIn GlobalInvocationId
68 OpDecorate %30 DescriptorSet 0
69 OpDecorate %30 Binding 0
70 OpDecorate %30 Coherent
71 OpDecorate %49 BuiltIn WorkgroupSize
73 %3 = OpTypeFunction %2
75 %7 = OpTypePointer Function %6
77 %10 = OpTypeVector %9 3
78 %11 = OpTypePointer Input %10
79 %12 = OpVariable %11 Input
81 %14 = OpTypePointer Input %9
84 %28 = OpTypeImage %9 1D 0 0 0 2 R32ui
85 %29 = OpTypePointer UniformConstant %28
86 %30 = OpVariable %29 UniformConstant
87 %32 = OpConstant %6 64
88 %46 = OpTypePointer Image %9
89 %49 = OpConstantComposite %10 %19 %19 %19
90 %4 = OpFunction %2 None %3
92 %8 = OpVariable %7 Function
93 %18 = OpVariable %7 Function
94 %23 = OpVariable %7 Function
95 %15 = OpAccessChain %14 %12 %13
97 %17 = OpBitcast %6 %16
99 %20 = OpAccessChain %14 %12 %19
101 %22 = OpBitcast %6 %21
103 %25 = OpAccessChain %14 %12 %24
105 %27 = OpBitcast %6 %26
108 %33 = OpSMod %6 %31 %32
111 %36 = OpIMul %6 %34 %35
114 %39 = OpIMul %6 %37 %38
115 %40 = OpIAdd %6 %36 %39
118 %43 = OpIMul %6 %41 %42
119 %44 = OpIAdd %6 %40 %43
120 %45 = OpBitcast %9 %44
121 %47 = OpImageTexelPointer %46 %30 %33 %13
122 %48 = ${OPNAME} %9 %47 %19 %13 ${LASTARG:default=%45}
127 const std::string kShader_1d_r32ui_intermediate_values = R"(
128 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
129 ; replaced with a template parameter and the last argument for it has been made optional.
132 ; precision highp uimage1D;
134 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
135 ; layout (r32ui, binding=0) coherent uniform uimage1D u_resultImage;
136 ; layout (r32ui, binding=1) writeonly uniform uimage1D u_intermValuesImage;
140 ; int gx = int(gl_GlobalInvocationID.x);
141 ; int gy = int(gl_GlobalInvocationID.y);
142 ; int gz = int(gl_GlobalInvocationID.z);
143 ; imageStore(u_intermValuesImage, gx, uvec4(imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz))));
148 ; Generator: Khronos Glslang Reference Front End; 7
153 %1 = OpExtInstImport "GLSL.std.450"
154 OpMemoryModel Logical GLSL450
155 OpEntryPoint GLCompute %4 "main" %12
156 OpExecutionMode %4 LocalSize 1 1 1
157 OpDecorate %12 BuiltIn GlobalInvocationId
158 OpDecorate %30 DescriptorSet 0
159 OpDecorate %30 Binding 1
160 OpDecorate %30 NonReadable
161 OpDecorate %33 DescriptorSet 0
162 OpDecorate %33 Binding 0
163 OpDecorate %33 Coherent
164 OpDecorate %54 BuiltIn WorkgroupSize
166 %3 = OpTypeFunction %2
168 %7 = OpTypePointer Function %6
170 %10 = OpTypeVector %9 3
171 %11 = OpTypePointer Input %10
172 %12 = OpVariable %11 Input
173 %13 = OpConstant %9 0
174 %14 = OpTypePointer Input %9
175 %19 = OpConstant %9 1
176 %24 = OpConstant %9 2
177 %28 = OpTypeImage %9 1D 0 0 0 2 R32ui
178 %29 = OpTypePointer UniformConstant %28
179 %30 = OpVariable %29 UniformConstant
180 %33 = OpVariable %29 UniformConstant
181 %35 = OpConstant %6 64
182 %49 = OpTypePointer Image %9
183 %52 = OpTypeVector %9 4
184 %54 = OpConstantComposite %10 %19 %19 %19
185 %4 = OpFunction %2 None %3
187 %8 = OpVariable %7 Function
188 %18 = OpVariable %7 Function
189 %23 = OpVariable %7 Function
190 %15 = OpAccessChain %14 %12 %13
192 %17 = OpBitcast %6 %16
194 %20 = OpAccessChain %14 %12 %19
196 %22 = OpBitcast %6 %21
198 %25 = OpAccessChain %14 %12 %24
200 %27 = OpBitcast %6 %26
205 %36 = OpSMod %6 %34 %35
208 %39 = OpIMul %6 %37 %38
211 %42 = OpIMul %6 %40 %41
212 %43 = OpIAdd %6 %39 %42
215 %46 = OpIMul %6 %44 %45
216 %47 = OpIAdd %6 %43 %46
217 %48 = OpBitcast %9 %47
218 %50 = OpImageTexelPointer %49 %33 %36 %13
219 %51 = ${OPNAME} %9 %50 %19 %13 ${LASTARG:default=%48}
220 %53 = OpCompositeConstruct %52 %51 %51 %51 %51
221 OpImageWrite %31 %32 %53
226 const std::string kShader_1d_r32i_end_result = R"(
227 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
228 ; replaced with a template parameter and the last argument for it has been made optional.
231 ; precision highp iimage1D;
233 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
234 ; layout (r32i, binding=0) coherent uniform iimage1D u_resultImage;
238 ; int gx = int(gl_GlobalInvocationID.x);
239 ; int gy = int(gl_GlobalInvocationID.y);
240 ; int gz = int(gl_GlobalInvocationID.z);
241 ; imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz));
246 ; Generator: Khronos Glslang Reference Front End; 7
251 %1 = OpExtInstImport "GLSL.std.450"
252 OpMemoryModel Logical GLSL450
253 OpEntryPoint GLCompute %4 "main" %12
254 OpExecutionMode %4 LocalSize 1 1 1
255 OpDecorate %12 BuiltIn GlobalInvocationId
256 OpDecorate %30 DescriptorSet 0
257 OpDecorate %30 Binding 0
258 OpDecorate %30 Coherent
259 OpDecorate %48 BuiltIn WorkgroupSize
261 %3 = OpTypeFunction %2
263 %7 = OpTypePointer Function %6
265 %10 = OpTypeVector %9 3
266 %11 = OpTypePointer Input %10
267 %12 = OpVariable %11 Input
268 %13 = OpConstant %9 0
269 %14 = OpTypePointer Input %9
270 %19 = OpConstant %9 1
271 %24 = OpConstant %9 2
272 %28 = OpTypeImage %6 1D 0 0 0 2 R32i
273 %29 = OpTypePointer UniformConstant %28
274 %30 = OpVariable %29 UniformConstant
275 %32 = OpConstant %6 64
276 %45 = OpTypePointer Image %6
277 %48 = OpConstantComposite %10 %19 %19 %19
278 %4 = OpFunction %2 None %3
280 %8 = OpVariable %7 Function
281 %18 = OpVariable %7 Function
282 %23 = OpVariable %7 Function
283 %15 = OpAccessChain %14 %12 %13
285 %17 = OpBitcast %6 %16
287 %20 = OpAccessChain %14 %12 %19
289 %22 = OpBitcast %6 %21
291 %25 = OpAccessChain %14 %12 %24
293 %27 = OpBitcast %6 %26
296 %33 = OpSMod %6 %31 %32
299 %36 = OpIMul %6 %34 %35
302 %39 = OpIMul %6 %37 %38
303 %40 = OpIAdd %6 %36 %39
306 %43 = OpIMul %6 %41 %42
307 %44 = OpIAdd %6 %40 %43
308 %46 = OpImageTexelPointer %45 %30 %33 %13
309 %47 = ${OPNAME} %6 %46 %19 %13 ${LASTARG:default=%44}
314 const std::string kShader_1d_r32i_intermediate_values = R"(
315 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
316 ; replaced with a template parameter and the last argument for it has been made optional.
319 ; precision highp iimage1D;
321 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
322 ; layout (r32i, binding=0) coherent uniform iimage1D u_resultImage;
323 ; layout (r32i, binding=1) writeonly uniform iimage1D u_intermValuesImage;
327 ; int gx = int(gl_GlobalInvocationID.x);
328 ; int gy = int(gl_GlobalInvocationID.y);
329 ; int gz = int(gl_GlobalInvocationID.z);
330 ; imageStore(u_intermValuesImage, gx, ivec4(imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz))));
335 ; Generator: Khronos Glslang Reference Front End; 7
340 %1 = OpExtInstImport "GLSL.std.450"
341 OpMemoryModel Logical GLSL450
342 OpEntryPoint GLCompute %4 "main" %12
343 OpExecutionMode %4 LocalSize 1 1 1
344 OpDecorate %12 BuiltIn GlobalInvocationId
345 OpDecorate %30 DescriptorSet 0
346 OpDecorate %30 Binding 1
347 OpDecorate %30 NonReadable
348 OpDecorate %33 DescriptorSet 0
349 OpDecorate %33 Binding 0
350 OpDecorate %33 Coherent
351 OpDecorate %53 BuiltIn WorkgroupSize
353 %3 = OpTypeFunction %2
355 %7 = OpTypePointer Function %6
357 %10 = OpTypeVector %9 3
358 %11 = OpTypePointer Input %10
359 %12 = OpVariable %11 Input
360 %13 = OpConstant %9 0
361 %14 = OpTypePointer Input %9
362 %19 = OpConstant %9 1
363 %24 = OpConstant %9 2
364 %28 = OpTypeImage %6 1D 0 0 0 2 R32i
365 %29 = OpTypePointer UniformConstant %28
366 %30 = OpVariable %29 UniformConstant
367 %33 = OpVariable %29 UniformConstant
368 %35 = OpConstant %6 64
369 %48 = OpTypePointer Image %6
370 %51 = OpTypeVector %6 4
371 %53 = OpConstantComposite %10 %19 %19 %19
372 %4 = OpFunction %2 None %3
374 %8 = OpVariable %7 Function
375 %18 = OpVariable %7 Function
376 %23 = OpVariable %7 Function
377 %15 = OpAccessChain %14 %12 %13
379 %17 = OpBitcast %6 %16
381 %20 = OpAccessChain %14 %12 %19
383 %22 = OpBitcast %6 %21
385 %25 = OpAccessChain %14 %12 %24
387 %27 = OpBitcast %6 %26
392 %36 = OpSMod %6 %34 %35
395 %39 = OpIMul %6 %37 %38
398 %42 = OpIMul %6 %40 %41
399 %43 = OpIAdd %6 %39 %42
402 %46 = OpIMul %6 %44 %45
403 %47 = OpIAdd %6 %43 %46
404 %49 = OpImageTexelPointer %48 %33 %36 %13
405 %50 = ${OPNAME} %6 %49 %19 %13 ${LASTARG:default=%47}
406 %52 = OpCompositeConstruct %51 %50 %50 %50 %50
407 OpImageWrite %31 %32 %52
412 const std::string kShader_1d_array_r32ui_end_result = R"(
413 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
414 ; replaced with a template parameter and the last argument for it has been made optional.
417 ; precision highp uimage1DArray;
419 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
420 ; layout (r32ui, binding=0) coherent uniform uimage1DArray u_resultImage;
424 ; int gx = int(gl_GlobalInvocationID.x);
425 ; int gy = int(gl_GlobalInvocationID.y);
426 ; int gz = int(gl_GlobalInvocationID.z);
427 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz));
432 ; Generator: Khronos Glslang Reference Front End; 7
437 %1 = OpExtInstImport "GLSL.std.450"
438 OpMemoryModel Logical GLSL450
439 OpEntryPoint GLCompute %4 "main" %12
440 OpExecutionMode %4 LocalSize 1 1 1
441 OpDecorate %12 BuiltIn GlobalInvocationId
442 OpDecorate %30 DescriptorSet 0
443 OpDecorate %30 Binding 0
444 OpDecorate %30 Coherent
445 OpDecorate %52 BuiltIn WorkgroupSize
447 %3 = OpTypeFunction %2
449 %7 = OpTypePointer Function %6
451 %10 = OpTypeVector %9 3
452 %11 = OpTypePointer Input %10
453 %12 = OpVariable %11 Input
454 %13 = OpConstant %9 0
455 %14 = OpTypePointer Input %9
456 %19 = OpConstant %9 1
457 %24 = OpConstant %9 2
458 %28 = OpTypeImage %9 1D 0 1 0 2 R32ui
459 %29 = OpTypePointer UniformConstant %28
460 %30 = OpVariable %29 UniformConstant
461 %32 = OpConstant %6 64
462 %35 = OpTypeVector %6 2
463 %49 = OpTypePointer Image %9
464 %52 = OpConstantComposite %10 %19 %19 %19
465 %4 = OpFunction %2 None %3
467 %8 = OpVariable %7 Function
468 %18 = OpVariable %7 Function
469 %23 = OpVariable %7 Function
470 %15 = OpAccessChain %14 %12 %13
472 %17 = OpBitcast %6 %16
474 %20 = OpAccessChain %14 %12 %19
476 %22 = OpBitcast %6 %21
478 %25 = OpAccessChain %14 %12 %24
480 %27 = OpBitcast %6 %26
483 %33 = OpSMod %6 %31 %32
485 %36 = OpCompositeConstruct %35 %33 %34
488 %39 = OpIMul %6 %37 %38
491 %42 = OpIMul %6 %40 %41
492 %43 = OpIAdd %6 %39 %42
495 %46 = OpIMul %6 %44 %45
496 %47 = OpIAdd %6 %43 %46
497 %48 = OpBitcast %9 %47
498 %50 = OpImageTexelPointer %49 %30 %36 %13
499 %51 = ${OPNAME} %9 %50 %19 %13 ${LASTARG:default=%48}
504 const std::string kShader_1d_array_r32ui_intermediate_values = R"(
505 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
506 ; replaced with a template parameter and the last argument for it has been made optional.
509 ; precision highp uimage1DArray;
511 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
512 ; layout (r32ui, binding=0) coherent uniform uimage1DArray u_resultImage;
513 ; layout (r32ui, binding=1) writeonly uniform uimage1DArray u_intermValuesImage;
517 ; int gx = int(gl_GlobalInvocationID.x);
518 ; int gy = int(gl_GlobalInvocationID.y);
519 ; int gz = int(gl_GlobalInvocationID.z);
520 ; imageStore(u_intermValuesImage, ivec2(gx,gy), uvec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz))));
525 ; Generator: Khronos Glslang Reference Front End; 7
530 %1 = OpExtInstImport "GLSL.std.450"
531 OpMemoryModel Logical GLSL450
532 OpEntryPoint GLCompute %4 "main" %12
533 OpExecutionMode %4 LocalSize 1 1 1
534 OpDecorate %12 BuiltIn GlobalInvocationId
535 OpDecorate %30 DescriptorSet 0
536 OpDecorate %30 Binding 1
537 OpDecorate %30 NonReadable
538 OpDecorate %36 DescriptorSet 0
539 OpDecorate %36 Binding 0
540 OpDecorate %36 Coherent
541 OpDecorate %59 BuiltIn WorkgroupSize
543 %3 = OpTypeFunction %2
545 %7 = OpTypePointer Function %6
547 %10 = OpTypeVector %9 3
548 %11 = OpTypePointer Input %10
549 %12 = OpVariable %11 Input
550 %13 = OpConstant %9 0
551 %14 = OpTypePointer Input %9
552 %19 = OpConstant %9 1
553 %24 = OpConstant %9 2
554 %28 = OpTypeImage %9 1D 0 1 0 2 R32ui
555 %29 = OpTypePointer UniformConstant %28
556 %30 = OpVariable %29 UniformConstant
557 %34 = OpTypeVector %6 2
558 %36 = OpVariable %29 UniformConstant
559 %38 = OpConstant %6 64
560 %54 = OpTypePointer Image %9
561 %57 = OpTypeVector %9 4
562 %59 = OpConstantComposite %10 %19 %19 %19
563 %4 = OpFunction %2 None %3
565 %8 = OpVariable %7 Function
566 %18 = OpVariable %7 Function
567 %23 = OpVariable %7 Function
568 %15 = OpAccessChain %14 %12 %13
570 %17 = OpBitcast %6 %16
572 %20 = OpAccessChain %14 %12 %19
574 %22 = OpBitcast %6 %21
576 %25 = OpAccessChain %14 %12 %24
578 %27 = OpBitcast %6 %26
583 %35 = OpCompositeConstruct %34 %32 %33
585 %39 = OpSMod %6 %37 %38
587 %41 = OpCompositeConstruct %34 %39 %40
590 %44 = OpIMul %6 %42 %43
593 %47 = OpIMul %6 %45 %46
594 %48 = OpIAdd %6 %44 %47
597 %51 = OpIMul %6 %49 %50
598 %52 = OpIAdd %6 %48 %51
599 %53 = OpBitcast %9 %52
600 %55 = OpImageTexelPointer %54 %36 %41 %13
601 %56 = ${OPNAME} %9 %55 %19 %13 ${LASTARG:default=%53}
602 %58 = OpCompositeConstruct %57 %56 %56 %56 %56
603 OpImageWrite %31 %35 %58
608 const std::string kShader_1d_array_r32i_end_result = R"(
609 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
610 ; replaced with a template parameter and the last argument for it has been made optional.
613 ; precision highp iimage1DArray;
615 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
616 ; layout (r32i, binding=0) coherent uniform iimage1DArray u_resultImage;
620 ; int gx = int(gl_GlobalInvocationID.x);
621 ; int gy = int(gl_GlobalInvocationID.y);
622 ; int gz = int(gl_GlobalInvocationID.z);
623 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz));
628 ; Generator: Khronos Glslang Reference Front End; 7
633 %1 = OpExtInstImport "GLSL.std.450"
634 OpMemoryModel Logical GLSL450
635 OpEntryPoint GLCompute %4 "main" %12
636 OpExecutionMode %4 LocalSize 1 1 1
637 OpDecorate %12 BuiltIn GlobalInvocationId
638 OpDecorate %30 DescriptorSet 0
639 OpDecorate %30 Binding 0
640 OpDecorate %30 Coherent
641 OpDecorate %51 BuiltIn WorkgroupSize
643 %3 = OpTypeFunction %2
645 %7 = OpTypePointer Function %6
647 %10 = OpTypeVector %9 3
648 %11 = OpTypePointer Input %10
649 %12 = OpVariable %11 Input
650 %13 = OpConstant %9 0
651 %14 = OpTypePointer Input %9
652 %19 = OpConstant %9 1
653 %24 = OpConstant %9 2
654 %28 = OpTypeImage %6 1D 0 1 0 2 R32i
655 %29 = OpTypePointer UniformConstant %28
656 %30 = OpVariable %29 UniformConstant
657 %32 = OpConstant %6 64
658 %35 = OpTypeVector %6 2
659 %48 = OpTypePointer Image %6
660 %51 = OpConstantComposite %10 %19 %19 %19
661 %4 = OpFunction %2 None %3
663 %8 = OpVariable %7 Function
664 %18 = OpVariable %7 Function
665 %23 = OpVariable %7 Function
666 %15 = OpAccessChain %14 %12 %13
668 %17 = OpBitcast %6 %16
670 %20 = OpAccessChain %14 %12 %19
672 %22 = OpBitcast %6 %21
674 %25 = OpAccessChain %14 %12 %24
676 %27 = OpBitcast %6 %26
679 %33 = OpSMod %6 %31 %32
681 %36 = OpCompositeConstruct %35 %33 %34
684 %39 = OpIMul %6 %37 %38
687 %42 = OpIMul %6 %40 %41
688 %43 = OpIAdd %6 %39 %42
691 %46 = OpIMul %6 %44 %45
692 %47 = OpIAdd %6 %43 %46
693 %49 = OpImageTexelPointer %48 %30 %36 %13
694 %50 = ${OPNAME} %6 %49 %19 %13 ${LASTARG:default=%47}
699 const std::string kShader_1d_array_r32i_intermediate_values = R"(
700 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
701 ; replaced with a template parameter and the last argument for it has been made optional.
704 ; precision highp iimage1DArray;
706 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
707 ; layout (r32i, binding=0) coherent uniform iimage1DArray u_resultImage;
708 ; layout (r32i, binding=1) writeonly uniform iimage1DArray u_intermValuesImage;
712 ; int gx = int(gl_GlobalInvocationID.x);
713 ; int gy = int(gl_GlobalInvocationID.y);
714 ; int gz = int(gl_GlobalInvocationID.z);
715 ; imageStore(u_intermValuesImage, ivec2(gx,gy), ivec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz))));
720 ; Generator: Khronos Glslang Reference Front End; 7
725 %1 = OpExtInstImport "GLSL.std.450"
726 OpMemoryModel Logical GLSL450
727 OpEntryPoint GLCompute %4 "main" %12
728 OpExecutionMode %4 LocalSize 1 1 1
729 OpDecorate %12 BuiltIn GlobalInvocationId
730 OpDecorate %30 DescriptorSet 0
731 OpDecorate %30 Binding 1
732 OpDecorate %30 NonReadable
733 OpDecorate %36 DescriptorSet 0
734 OpDecorate %36 Binding 0
735 OpDecorate %36 Coherent
736 OpDecorate %58 BuiltIn WorkgroupSize
738 %3 = OpTypeFunction %2
740 %7 = OpTypePointer Function %6
742 %10 = OpTypeVector %9 3
743 %11 = OpTypePointer Input %10
744 %12 = OpVariable %11 Input
745 %13 = OpConstant %9 0
746 %14 = OpTypePointer Input %9
747 %19 = OpConstant %9 1
748 %24 = OpConstant %9 2
749 %28 = OpTypeImage %6 1D 0 1 0 2 R32i
750 %29 = OpTypePointer UniformConstant %28
751 %30 = OpVariable %29 UniformConstant
752 %34 = OpTypeVector %6 2
753 %36 = OpVariable %29 UniformConstant
754 %38 = OpConstant %6 64
755 %53 = OpTypePointer Image %6
756 %56 = OpTypeVector %6 4
757 %58 = OpConstantComposite %10 %19 %19 %19
758 %4 = OpFunction %2 None %3
760 %8 = OpVariable %7 Function
761 %18 = OpVariable %7 Function
762 %23 = OpVariable %7 Function
763 %15 = OpAccessChain %14 %12 %13
765 %17 = OpBitcast %6 %16
767 %20 = OpAccessChain %14 %12 %19
769 %22 = OpBitcast %6 %21
771 %25 = OpAccessChain %14 %12 %24
773 %27 = OpBitcast %6 %26
778 %35 = OpCompositeConstruct %34 %32 %33
780 %39 = OpSMod %6 %37 %38
782 %41 = OpCompositeConstruct %34 %39 %40
785 %44 = OpIMul %6 %42 %43
788 %47 = OpIMul %6 %45 %46
789 %48 = OpIAdd %6 %44 %47
792 %51 = OpIMul %6 %49 %50
793 %52 = OpIAdd %6 %48 %51
794 %54 = OpImageTexelPointer %53 %36 %41 %13
795 %55 = ${OPNAME} %6 %54 %19 %13 ${LASTARG:default=%52}
796 %57 = OpCompositeConstruct %56 %55 %55 %55 %55
797 OpImageWrite %31 %35 %57
802 const std::string kShader_2d_r32ui_end_result = R"(
803 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
804 ; replaced with a template parameter and the last argument for it has been made optional.
807 ; precision highp uimage2D;
809 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
810 ; layout (r32ui, binding=0) coherent uniform uimage2D u_resultImage;
814 ; int gx = int(gl_GlobalInvocationID.x);
815 ; int gy = int(gl_GlobalInvocationID.y);
816 ; int gz = int(gl_GlobalInvocationID.z);
817 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz));
822 ; Generator: Khronos Glslang Reference Front End; 7
826 %1 = OpExtInstImport "GLSL.std.450"
827 OpMemoryModel Logical GLSL450
828 OpEntryPoint GLCompute %4 "main" %12
829 OpExecutionMode %4 LocalSize 1 1 1
830 OpDecorate %12 BuiltIn GlobalInvocationId
831 OpDecorate %30 DescriptorSet 0
832 OpDecorate %30 Binding 0
833 OpDecorate %30 Coherent
834 OpDecorate %52 BuiltIn WorkgroupSize
836 %3 = OpTypeFunction %2
838 %7 = OpTypePointer Function %6
840 %10 = OpTypeVector %9 3
841 %11 = OpTypePointer Input %10
842 %12 = OpVariable %11 Input
843 %13 = OpConstant %9 0
844 %14 = OpTypePointer Input %9
845 %19 = OpConstant %9 1
846 %24 = OpConstant %9 2
847 %28 = OpTypeImage %9 2D 0 0 0 2 R32ui
848 %29 = OpTypePointer UniformConstant %28
849 %30 = OpVariable %29 UniformConstant
850 %32 = OpConstant %6 64
851 %35 = OpTypeVector %6 2
852 %49 = OpTypePointer Image %9
853 %52 = OpConstantComposite %10 %19 %19 %19
854 %4 = OpFunction %2 None %3
856 %8 = OpVariable %7 Function
857 %18 = OpVariable %7 Function
858 %23 = OpVariable %7 Function
859 %15 = OpAccessChain %14 %12 %13
861 %17 = OpBitcast %6 %16
863 %20 = OpAccessChain %14 %12 %19
865 %22 = OpBitcast %6 %21
867 %25 = OpAccessChain %14 %12 %24
869 %27 = OpBitcast %6 %26
872 %33 = OpSMod %6 %31 %32
874 %36 = OpCompositeConstruct %35 %33 %34
877 %39 = OpIMul %6 %37 %38
880 %42 = OpIMul %6 %40 %41
881 %43 = OpIAdd %6 %39 %42
884 %46 = OpIMul %6 %44 %45
885 %47 = OpIAdd %6 %43 %46
886 %48 = OpBitcast %9 %47
887 %50 = OpImageTexelPointer %49 %30 %36 %13
888 %51 = ${OPNAME} %9 %50 %19 %13 ${LASTARG:default=%48}
893 const std::string kShader_2d_r32ui_intermediate_values = R"(
894 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
895 ; replaced with a template parameter and the last argument for it has been made optional.
898 ; precision highp uimage2D;
900 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
901 ; layout (r32ui, binding=0) coherent uniform uimage2D u_resultImage;
902 ; layout (r32ui, binding=1) writeonly uniform uimage2D u_intermValuesImage;
906 ; int gx = int(gl_GlobalInvocationID.x);
907 ; int gy = int(gl_GlobalInvocationID.y);
908 ; int gz = int(gl_GlobalInvocationID.z);
909 ; imageStore(u_intermValuesImage, ivec2(gx,gy), uvec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz))));
914 ; Generator: Khronos Glslang Reference Front End; 7
918 %1 = OpExtInstImport "GLSL.std.450"
919 OpMemoryModel Logical GLSL450
920 OpEntryPoint GLCompute %4 "main" %12
921 OpExecutionMode %4 LocalSize 1 1 1
922 OpDecorate %12 BuiltIn GlobalInvocationId
923 OpDecorate %30 DescriptorSet 0
924 OpDecorate %30 Binding 1
925 OpDecorate %30 NonReadable
926 OpDecorate %36 DescriptorSet 0
927 OpDecorate %36 Binding 0
928 OpDecorate %36 Coherent
929 OpDecorate %59 BuiltIn WorkgroupSize
931 %3 = OpTypeFunction %2
933 %7 = OpTypePointer Function %6
935 %10 = OpTypeVector %9 3
936 %11 = OpTypePointer Input %10
937 %12 = OpVariable %11 Input
938 %13 = OpConstant %9 0
939 %14 = OpTypePointer Input %9
940 %19 = OpConstant %9 1
941 %24 = OpConstant %9 2
942 %28 = OpTypeImage %9 2D 0 0 0 2 R32ui
943 %29 = OpTypePointer UniformConstant %28
944 %30 = OpVariable %29 UniformConstant
945 %34 = OpTypeVector %6 2
946 %36 = OpVariable %29 UniformConstant
947 %38 = OpConstant %6 64
948 %54 = OpTypePointer Image %9
949 %57 = OpTypeVector %9 4
950 %59 = OpConstantComposite %10 %19 %19 %19
951 %4 = OpFunction %2 None %3
953 %8 = OpVariable %7 Function
954 %18 = OpVariable %7 Function
955 %23 = OpVariable %7 Function
956 %15 = OpAccessChain %14 %12 %13
958 %17 = OpBitcast %6 %16
960 %20 = OpAccessChain %14 %12 %19
962 %22 = OpBitcast %6 %21
964 %25 = OpAccessChain %14 %12 %24
966 %27 = OpBitcast %6 %26
971 %35 = OpCompositeConstruct %34 %32 %33
973 %39 = OpSMod %6 %37 %38
975 %41 = OpCompositeConstruct %34 %39 %40
978 %44 = OpIMul %6 %42 %43
981 %47 = OpIMul %6 %45 %46
982 %48 = OpIAdd %6 %44 %47
985 %51 = OpIMul %6 %49 %50
986 %52 = OpIAdd %6 %48 %51
987 %53 = OpBitcast %9 %52
988 %55 = OpImageTexelPointer %54 %36 %41 %13
989 %56 = ${OPNAME} %9 %55 %19 %13 ${LASTARG:default=%53}
990 %58 = OpCompositeConstruct %57 %56 %56 %56 %56
991 OpImageWrite %31 %35 %58
996 const std::string kShader_2d_r32i_end_result = R"(
997 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
998 ; replaced with a template parameter and the last argument for it has been made optional.
1001 ; precision highp iimage2D;
1003 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1004 ; layout (r32i, binding=0) coherent uniform iimage2D u_resultImage;
1008 ; int gx = int(gl_GlobalInvocationID.x);
1009 ; int gy = int(gl_GlobalInvocationID.y);
1010 ; int gz = int(gl_GlobalInvocationID.z);
1011 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz));
1016 ; Generator: Khronos Glslang Reference Front End; 7
1020 %1 = OpExtInstImport "GLSL.std.450"
1021 OpMemoryModel Logical GLSL450
1022 OpEntryPoint GLCompute %4 "main" %12
1023 OpExecutionMode %4 LocalSize 1 1 1
1024 OpDecorate %12 BuiltIn GlobalInvocationId
1025 OpDecorate %30 DescriptorSet 0
1026 OpDecorate %30 Binding 0
1027 OpDecorate %30 Coherent
1028 OpDecorate %51 BuiltIn WorkgroupSize
1030 %3 = OpTypeFunction %2
1032 %7 = OpTypePointer Function %6
1034 %10 = OpTypeVector %9 3
1035 %11 = OpTypePointer Input %10
1036 %12 = OpVariable %11 Input
1037 %13 = OpConstant %9 0
1038 %14 = OpTypePointer Input %9
1039 %19 = OpConstant %9 1
1040 %24 = OpConstant %9 2
1041 %28 = OpTypeImage %6 2D 0 0 0 2 R32i
1042 %29 = OpTypePointer UniformConstant %28
1043 %30 = OpVariable %29 UniformConstant
1044 %32 = OpConstant %6 64
1045 %35 = OpTypeVector %6 2
1046 %48 = OpTypePointer Image %6
1047 %51 = OpConstantComposite %10 %19 %19 %19
1048 %4 = OpFunction %2 None %3
1050 %8 = OpVariable %7 Function
1051 %18 = OpVariable %7 Function
1052 %23 = OpVariable %7 Function
1053 %15 = OpAccessChain %14 %12 %13
1055 %17 = OpBitcast %6 %16
1057 %20 = OpAccessChain %14 %12 %19
1059 %22 = OpBitcast %6 %21
1061 %25 = OpAccessChain %14 %12 %24
1063 %27 = OpBitcast %6 %26
1066 %33 = OpSMod %6 %31 %32
1068 %36 = OpCompositeConstruct %35 %33 %34
1071 %39 = OpIMul %6 %37 %38
1074 %42 = OpIMul %6 %40 %41
1075 %43 = OpIAdd %6 %39 %42
1078 %46 = OpIMul %6 %44 %45
1079 %47 = OpIAdd %6 %43 %46
1080 %49 = OpImageTexelPointer %48 %30 %36 %13
1081 %50 = ${OPNAME} %6 %49 %19 %13 ${LASTARG:default=%47}
1086 const std::string kShader_2d_r32i_intermediate_values = R"(
1087 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1088 ; replaced with a template parameter and the last argument for it has been made optional.
1091 ; precision highp iimage2D;
1093 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1094 ; layout (r32i, binding=0) coherent uniform iimage2D u_resultImage;
1095 ; layout (r32i, binding=1) writeonly uniform iimage2D u_intermValuesImage;
1099 ; int gx = int(gl_GlobalInvocationID.x);
1100 ; int gy = int(gl_GlobalInvocationID.y);
1101 ; int gz = int(gl_GlobalInvocationID.z);
1102 ; imageStore(u_intermValuesImage, ivec2(gx,gy), ivec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz))));
1107 ; Generator: Khronos Glslang Reference Front End; 7
1111 %1 = OpExtInstImport "GLSL.std.450"
1112 OpMemoryModel Logical GLSL450
1113 OpEntryPoint GLCompute %4 "main" %12
1114 OpExecutionMode %4 LocalSize 1 1 1
1115 OpDecorate %12 BuiltIn GlobalInvocationId
1116 OpDecorate %30 DescriptorSet 0
1117 OpDecorate %30 Binding 1
1118 OpDecorate %30 NonReadable
1119 OpDecorate %36 DescriptorSet 0
1120 OpDecorate %36 Binding 0
1121 OpDecorate %36 Coherent
1122 OpDecorate %58 BuiltIn WorkgroupSize
1124 %3 = OpTypeFunction %2
1126 %7 = OpTypePointer Function %6
1128 %10 = OpTypeVector %9 3
1129 %11 = OpTypePointer Input %10
1130 %12 = OpVariable %11 Input
1131 %13 = OpConstant %9 0
1132 %14 = OpTypePointer Input %9
1133 %19 = OpConstant %9 1
1134 %24 = OpConstant %9 2
1135 %28 = OpTypeImage %6 2D 0 0 0 2 R32i
1136 %29 = OpTypePointer UniformConstant %28
1137 %30 = OpVariable %29 UniformConstant
1138 %34 = OpTypeVector %6 2
1139 %36 = OpVariable %29 UniformConstant
1140 %38 = OpConstant %6 64
1141 %53 = OpTypePointer Image %6
1142 %56 = OpTypeVector %6 4
1143 %58 = OpConstantComposite %10 %19 %19 %19
1144 %4 = OpFunction %2 None %3
1146 %8 = OpVariable %7 Function
1147 %18 = OpVariable %7 Function
1148 %23 = OpVariable %7 Function
1149 %15 = OpAccessChain %14 %12 %13
1151 %17 = OpBitcast %6 %16
1153 %20 = OpAccessChain %14 %12 %19
1155 %22 = OpBitcast %6 %21
1157 %25 = OpAccessChain %14 %12 %24
1159 %27 = OpBitcast %6 %26
1161 %31 = OpLoad %28 %30
1164 %35 = OpCompositeConstruct %34 %32 %33
1166 %39 = OpSMod %6 %37 %38
1168 %41 = OpCompositeConstruct %34 %39 %40
1171 %44 = OpIMul %6 %42 %43
1174 %47 = OpIMul %6 %45 %46
1175 %48 = OpIAdd %6 %44 %47
1178 %51 = OpIMul %6 %49 %50
1179 %52 = OpIAdd %6 %48 %51
1180 %54 = OpImageTexelPointer %53 %36 %41 %13
1181 %55 = ${OPNAME} %6 %54 %19 %13 ${LASTARG:default=%52}
1182 %57 = OpCompositeConstruct %56 %55 %55 %55 %55
1183 OpImageWrite %31 %35 %57
1188 const std::string kShader_2d_array_r32ui_end_result = R"(
1189 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1190 ; replaced with a template parameter and the last argument for it has been made optional.
1193 ; precision highp uimage2DArray;
1195 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1196 ; layout (r32ui, binding=0) coherent uniform uimage2DArray u_resultImage;
1200 ; int gx = int(gl_GlobalInvocationID.x);
1201 ; int gy = int(gl_GlobalInvocationID.y);
1202 ; int gz = int(gl_GlobalInvocationID.z);
1203 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz));
1208 ; Generator: Khronos Glslang Reference Front End; 7
1212 %1 = OpExtInstImport "GLSL.std.450"
1213 OpMemoryModel Logical GLSL450
1214 OpEntryPoint GLCompute %4 "main" %12
1215 OpExecutionMode %4 LocalSize 1 1 1
1216 OpDecorate %12 BuiltIn GlobalInvocationId
1217 OpDecorate %30 DescriptorSet 0
1218 OpDecorate %30 Binding 0
1219 OpDecorate %30 Coherent
1220 OpDecorate %53 BuiltIn WorkgroupSize
1222 %3 = OpTypeFunction %2
1224 %7 = OpTypePointer Function %6
1226 %10 = OpTypeVector %9 3
1227 %11 = OpTypePointer Input %10
1228 %12 = OpVariable %11 Input
1229 %13 = OpConstant %9 0
1230 %14 = OpTypePointer Input %9
1231 %19 = OpConstant %9 1
1232 %24 = OpConstant %9 2
1233 %28 = OpTypeImage %9 2D 0 1 0 2 R32ui
1234 %29 = OpTypePointer UniformConstant %28
1235 %30 = OpVariable %29 UniformConstant
1236 %32 = OpConstant %6 64
1237 %36 = OpTypeVector %6 3
1238 %50 = OpTypePointer Image %9
1239 %53 = OpConstantComposite %10 %19 %19 %19
1240 %4 = OpFunction %2 None %3
1242 %8 = OpVariable %7 Function
1243 %18 = OpVariable %7 Function
1244 %23 = OpVariable %7 Function
1245 %15 = OpAccessChain %14 %12 %13
1247 %17 = OpBitcast %6 %16
1249 %20 = OpAccessChain %14 %12 %19
1251 %22 = OpBitcast %6 %21
1253 %25 = OpAccessChain %14 %12 %24
1255 %27 = OpBitcast %6 %26
1258 %33 = OpSMod %6 %31 %32
1261 %37 = OpCompositeConstruct %36 %33 %34 %35
1264 %40 = OpIMul %6 %38 %39
1267 %43 = OpIMul %6 %41 %42
1268 %44 = OpIAdd %6 %40 %43
1271 %47 = OpIMul %6 %45 %46
1272 %48 = OpIAdd %6 %44 %47
1273 %49 = OpBitcast %9 %48
1274 %51 = OpImageTexelPointer %50 %30 %37 %13
1275 %52 = ${OPNAME} %9 %51 %19 %13 ${LASTARG:default=%49}
1280 const std::string kShader_2d_array_r32ui_intermediate_values = R"(
1281 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1282 ; replaced with a template parameter and the last argument for it has been made optional.
1285 ; precision highp uimage2DArray;
1287 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1288 ; layout (r32ui, binding=0) coherent uniform uimage2DArray u_resultImage;
1289 ; layout (r32ui, binding=1) writeonly uniform uimage2DArray u_intermValuesImage;
1293 ; int gx = int(gl_GlobalInvocationID.x);
1294 ; int gy = int(gl_GlobalInvocationID.y);
1295 ; int gz = int(gl_GlobalInvocationID.z);
1296 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), uvec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz))));
1301 ; Generator: Khronos Glslang Reference Front End; 7
1305 %1 = OpExtInstImport "GLSL.std.450"
1306 OpMemoryModel Logical GLSL450
1307 OpEntryPoint GLCompute %4 "main" %12
1308 OpExecutionMode %4 LocalSize 1 1 1
1309 OpDecorate %12 BuiltIn GlobalInvocationId
1310 OpDecorate %30 DescriptorSet 0
1311 OpDecorate %30 Binding 1
1312 OpDecorate %30 NonReadable
1313 OpDecorate %37 DescriptorSet 0
1314 OpDecorate %37 Binding 0
1315 OpDecorate %37 Coherent
1316 OpDecorate %61 BuiltIn WorkgroupSize
1318 %3 = OpTypeFunction %2
1320 %7 = OpTypePointer Function %6
1322 %10 = OpTypeVector %9 3
1323 %11 = OpTypePointer Input %10
1324 %12 = OpVariable %11 Input
1325 %13 = OpConstant %9 0
1326 %14 = OpTypePointer Input %9
1327 %19 = OpConstant %9 1
1328 %24 = OpConstant %9 2
1329 %28 = OpTypeImage %9 2D 0 1 0 2 R32ui
1330 %29 = OpTypePointer UniformConstant %28
1331 %30 = OpVariable %29 UniformConstant
1332 %35 = OpTypeVector %6 3
1333 %37 = OpVariable %29 UniformConstant
1334 %39 = OpConstant %6 64
1335 %56 = OpTypePointer Image %9
1336 %59 = OpTypeVector %9 4
1337 %61 = OpConstantComposite %10 %19 %19 %19
1338 %4 = OpFunction %2 None %3
1340 %8 = OpVariable %7 Function
1341 %18 = OpVariable %7 Function
1342 %23 = OpVariable %7 Function
1343 %15 = OpAccessChain %14 %12 %13
1345 %17 = OpBitcast %6 %16
1347 %20 = OpAccessChain %14 %12 %19
1349 %22 = OpBitcast %6 %21
1351 %25 = OpAccessChain %14 %12 %24
1353 %27 = OpBitcast %6 %26
1355 %31 = OpLoad %28 %30
1359 %36 = OpCompositeConstruct %35 %32 %33 %34
1361 %40 = OpSMod %6 %38 %39
1364 %43 = OpCompositeConstruct %35 %40 %41 %42
1367 %46 = OpIMul %6 %44 %45
1370 %49 = OpIMul %6 %47 %48
1371 %50 = OpIAdd %6 %46 %49
1374 %53 = OpIMul %6 %51 %52
1375 %54 = OpIAdd %6 %50 %53
1376 %55 = OpBitcast %9 %54
1377 %57 = OpImageTexelPointer %56 %37 %43 %13
1378 %58 = ${OPNAME} %9 %57 %19 %13 ${LASTARG:default=%55}
1379 %60 = OpCompositeConstruct %59 %58 %58 %58 %58
1380 OpImageWrite %31 %36 %60
1385 const std::string kShader_2d_array_r32i_end_result = R"(
1386 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1387 ; replaced with a template parameter and the last argument for it has been made optional.
1390 ; precision highp iimage2DArray;
1392 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1393 ; layout (r32i, binding=0) coherent uniform iimage2DArray u_resultImage;
1397 ; int gx = int(gl_GlobalInvocationID.x);
1398 ; int gy = int(gl_GlobalInvocationID.y);
1399 ; int gz = int(gl_GlobalInvocationID.z);
1400 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz));
1405 ; Generator: Khronos Glslang Reference Front End; 7
1409 %1 = OpExtInstImport "GLSL.std.450"
1410 OpMemoryModel Logical GLSL450
1411 OpEntryPoint GLCompute %4 "main" %12
1412 OpExecutionMode %4 LocalSize 1 1 1
1413 OpDecorate %12 BuiltIn GlobalInvocationId
1414 OpDecorate %30 DescriptorSet 0
1415 OpDecorate %30 Binding 0
1416 OpDecorate %30 Coherent
1417 OpDecorate %52 BuiltIn WorkgroupSize
1419 %3 = OpTypeFunction %2
1421 %7 = OpTypePointer Function %6
1423 %10 = OpTypeVector %9 3
1424 %11 = OpTypePointer Input %10
1425 %12 = OpVariable %11 Input
1426 %13 = OpConstant %9 0
1427 %14 = OpTypePointer Input %9
1428 %19 = OpConstant %9 1
1429 %24 = OpConstant %9 2
1430 %28 = OpTypeImage %6 2D 0 1 0 2 R32i
1431 %29 = OpTypePointer UniformConstant %28
1432 %30 = OpVariable %29 UniformConstant
1433 %32 = OpConstant %6 64
1434 %36 = OpTypeVector %6 3
1435 %49 = OpTypePointer Image %6
1436 %52 = OpConstantComposite %10 %19 %19 %19
1437 %4 = OpFunction %2 None %3
1439 %8 = OpVariable %7 Function
1440 %18 = OpVariable %7 Function
1441 %23 = OpVariable %7 Function
1442 %15 = OpAccessChain %14 %12 %13
1444 %17 = OpBitcast %6 %16
1446 %20 = OpAccessChain %14 %12 %19
1448 %22 = OpBitcast %6 %21
1450 %25 = OpAccessChain %14 %12 %24
1452 %27 = OpBitcast %6 %26
1455 %33 = OpSMod %6 %31 %32
1458 %37 = OpCompositeConstruct %36 %33 %34 %35
1461 %40 = OpIMul %6 %38 %39
1464 %43 = OpIMul %6 %41 %42
1465 %44 = OpIAdd %6 %40 %43
1468 %47 = OpIMul %6 %45 %46
1469 %48 = OpIAdd %6 %44 %47
1470 %50 = OpImageTexelPointer %49 %30 %37 %13
1471 %51 = ${OPNAME} %6 %50 %19 %13 ${LASTARG:default=%48}
1476 const std::string kShader_2d_array_r32i_intermediate_values = R"(
1477 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1478 ; replaced with a template parameter and the last argument for it has been made optional.
1481 ; precision highp iimage2DArray;
1483 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1484 ; layout (r32i, binding=0) coherent uniform iimage2DArray u_resultImage;
1485 ; layout (r32i, binding=1) writeonly uniform iimage2DArray u_intermValuesImage;
1489 ; int gx = int(gl_GlobalInvocationID.x);
1490 ; int gy = int(gl_GlobalInvocationID.y);
1491 ; int gz = int(gl_GlobalInvocationID.z);
1492 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), ivec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz))));
1497 ; Generator: Khronos Glslang Reference Front End; 7
1501 %1 = OpExtInstImport "GLSL.std.450"
1502 OpMemoryModel Logical GLSL450
1503 OpEntryPoint GLCompute %4 "main" %12
1504 OpExecutionMode %4 LocalSize 1 1 1
1505 OpDecorate %12 BuiltIn GlobalInvocationId
1506 OpDecorate %30 DescriptorSet 0
1507 OpDecorate %30 Binding 1
1508 OpDecorate %30 NonReadable
1509 OpDecorate %37 DescriptorSet 0
1510 OpDecorate %37 Binding 0
1511 OpDecorate %37 Coherent
1512 OpDecorate %60 BuiltIn WorkgroupSize
1514 %3 = OpTypeFunction %2
1516 %7 = OpTypePointer Function %6
1518 %10 = OpTypeVector %9 3
1519 %11 = OpTypePointer Input %10
1520 %12 = OpVariable %11 Input
1521 %13 = OpConstant %9 0
1522 %14 = OpTypePointer Input %9
1523 %19 = OpConstant %9 1
1524 %24 = OpConstant %9 2
1525 %28 = OpTypeImage %6 2D 0 1 0 2 R32i
1526 %29 = OpTypePointer UniformConstant %28
1527 %30 = OpVariable %29 UniformConstant
1528 %35 = OpTypeVector %6 3
1529 %37 = OpVariable %29 UniformConstant
1530 %39 = OpConstant %6 64
1531 %55 = OpTypePointer Image %6
1532 %58 = OpTypeVector %6 4
1533 %60 = OpConstantComposite %10 %19 %19 %19
1534 %4 = OpFunction %2 None %3
1536 %8 = OpVariable %7 Function
1537 %18 = OpVariable %7 Function
1538 %23 = OpVariable %7 Function
1539 %15 = OpAccessChain %14 %12 %13
1541 %17 = OpBitcast %6 %16
1543 %20 = OpAccessChain %14 %12 %19
1545 %22 = OpBitcast %6 %21
1547 %25 = OpAccessChain %14 %12 %24
1549 %27 = OpBitcast %6 %26
1551 %31 = OpLoad %28 %30
1555 %36 = OpCompositeConstruct %35 %32 %33 %34
1557 %40 = OpSMod %6 %38 %39
1560 %43 = OpCompositeConstruct %35 %40 %41 %42
1563 %46 = OpIMul %6 %44 %45
1566 %49 = OpIMul %6 %47 %48
1567 %50 = OpIAdd %6 %46 %49
1570 %53 = OpIMul %6 %51 %52
1571 %54 = OpIAdd %6 %50 %53
1572 %56 = OpImageTexelPointer %55 %37 %43 %13
1573 %57 = ${OPNAME} %6 %56 %19 %13 ${LASTARG:default=%54}
1574 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
1575 OpImageWrite %31 %36 %59
1580 const std::string kShader_3d_r32ui_end_result = R"(
1581 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1582 ; replaced with a template parameter and the last argument for it has been made optional.
1585 ; precision highp uimage3D;
1587 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1588 ; layout (r32ui, binding=0) coherent uniform uimage3D u_resultImage;
1592 ; int gx = int(gl_GlobalInvocationID.x);
1593 ; int gy = int(gl_GlobalInvocationID.y);
1594 ; int gz = int(gl_GlobalInvocationID.z);
1595 ; imageAtomicAdd(u_resultImage, ivec3(gx % 48,gy,gz), uint(gx*gx + gy*gy + gz*gz));
1600 ; Generator: Khronos Glslang Reference Front End; 7
1604 %1 = OpExtInstImport "GLSL.std.450"
1605 OpMemoryModel Logical GLSL450
1606 OpEntryPoint GLCompute %4 "main" %12
1607 OpExecutionMode %4 LocalSize 1 1 1
1608 OpDecorate %12 BuiltIn GlobalInvocationId
1609 OpDecorate %30 DescriptorSet 0
1610 OpDecorate %30 Binding 0
1611 OpDecorate %30 Coherent
1612 OpDecorate %53 BuiltIn WorkgroupSize
1614 %3 = OpTypeFunction %2
1616 %7 = OpTypePointer Function %6
1618 %10 = OpTypeVector %9 3
1619 %11 = OpTypePointer Input %10
1620 %12 = OpVariable %11 Input
1621 %13 = OpConstant %9 0
1622 %14 = OpTypePointer Input %9
1623 %19 = OpConstant %9 1
1624 %24 = OpConstant %9 2
1625 %28 = OpTypeImage %9 3D 0 0 0 2 R32ui
1626 %29 = OpTypePointer UniformConstant %28
1627 %30 = OpVariable %29 UniformConstant
1628 %32 = OpConstant %6 48
1629 %36 = OpTypeVector %6 3
1630 %50 = OpTypePointer Image %9
1631 %53 = OpConstantComposite %10 %19 %19 %19
1632 %4 = OpFunction %2 None %3
1634 %8 = OpVariable %7 Function
1635 %18 = OpVariable %7 Function
1636 %23 = OpVariable %7 Function
1637 %15 = OpAccessChain %14 %12 %13
1639 %17 = OpBitcast %6 %16
1641 %20 = OpAccessChain %14 %12 %19
1643 %22 = OpBitcast %6 %21
1645 %25 = OpAccessChain %14 %12 %24
1647 %27 = OpBitcast %6 %26
1650 %33 = OpSMod %6 %31 %32
1653 %37 = OpCompositeConstruct %36 %33 %34 %35
1656 %40 = OpIMul %6 %38 %39
1659 %43 = OpIMul %6 %41 %42
1660 %44 = OpIAdd %6 %40 %43
1663 %47 = OpIMul %6 %45 %46
1664 %48 = OpIAdd %6 %44 %47
1665 %49 = OpBitcast %9 %48
1666 %51 = OpImageTexelPointer %50 %30 %37 %13
1667 %52 = ${OPNAME} %9 %51 %19 %13 ${LASTARG:default=%49}
1672 const std::string kShader_3d_r32ui_intermediate_values = R"(
1673 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1674 ; replaced with a template parameter and the last argument for it has been made optional.
1677 ; precision highp uimage3D;
1679 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1680 ; layout (r32ui, binding=0) coherent uniform uimage3D u_resultImage;
1681 ; layout (r32ui, binding=1) writeonly uniform uimage3D u_intermValuesImage;
1685 ; int gx = int(gl_GlobalInvocationID.x);
1686 ; int gy = int(gl_GlobalInvocationID.y);
1687 ; int gz = int(gl_GlobalInvocationID.z);
1688 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), uvec4(imageAtomicAdd(u_resultImage, ivec3(gx % 48,gy,gz), uint(gx*gx + gy*gy + gz*gz))));
1693 ; Generator: Khronos Glslang Reference Front End; 7
1697 %1 = OpExtInstImport "GLSL.std.450"
1698 OpMemoryModel Logical GLSL450
1699 OpEntryPoint GLCompute %4 "main" %12
1700 OpExecutionMode %4 LocalSize 1 1 1
1701 OpDecorate %12 BuiltIn GlobalInvocationId
1702 OpDecorate %30 DescriptorSet 0
1703 OpDecorate %30 Binding 1
1704 OpDecorate %30 NonReadable
1705 OpDecorate %37 DescriptorSet 0
1706 OpDecorate %37 Binding 0
1707 OpDecorate %37 Coherent
1708 OpDecorate %61 BuiltIn WorkgroupSize
1710 %3 = OpTypeFunction %2
1712 %7 = OpTypePointer Function %6
1714 %10 = OpTypeVector %9 3
1715 %11 = OpTypePointer Input %10
1716 %12 = OpVariable %11 Input
1717 %13 = OpConstant %9 0
1718 %14 = OpTypePointer Input %9
1719 %19 = OpConstant %9 1
1720 %24 = OpConstant %9 2
1721 %28 = OpTypeImage %9 3D 0 0 0 2 R32ui
1722 %29 = OpTypePointer UniformConstant %28
1723 %30 = OpVariable %29 UniformConstant
1724 %35 = OpTypeVector %6 3
1725 %37 = OpVariable %29 UniformConstant
1726 %39 = OpConstant %6 48
1727 %56 = OpTypePointer Image %9
1728 %59 = OpTypeVector %9 4
1729 %61 = OpConstantComposite %10 %19 %19 %19
1730 %4 = OpFunction %2 None %3
1732 %8 = OpVariable %7 Function
1733 %18 = OpVariable %7 Function
1734 %23 = OpVariable %7 Function
1735 %15 = OpAccessChain %14 %12 %13
1737 %17 = OpBitcast %6 %16
1739 %20 = OpAccessChain %14 %12 %19
1741 %22 = OpBitcast %6 %21
1743 %25 = OpAccessChain %14 %12 %24
1745 %27 = OpBitcast %6 %26
1747 %31 = OpLoad %28 %30
1751 %36 = OpCompositeConstruct %35 %32 %33 %34
1753 %40 = OpSMod %6 %38 %39
1756 %43 = OpCompositeConstruct %35 %40 %41 %42
1759 %46 = OpIMul %6 %44 %45
1762 %49 = OpIMul %6 %47 %48
1763 %50 = OpIAdd %6 %46 %49
1766 %53 = OpIMul %6 %51 %52
1767 %54 = OpIAdd %6 %50 %53
1768 %55 = OpBitcast %9 %54
1769 %57 = OpImageTexelPointer %56 %37 %43 %13
1770 %58 = ${OPNAME} %9 %57 %19 %13 ${LASTARG:default=%55}
1771 %60 = OpCompositeConstruct %59 %58 %58 %58 %58
1772 OpImageWrite %31 %36 %60
1777 const std::string kShader_3d_r32i_end_result = R"(
1778 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1779 ; replaced with a template parameter and the last argument for it has been made optional.
1782 ; precision highp iimage3D;
1784 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1785 ; layout (r32i, binding=0) coherent uniform iimage3D u_resultImage;
1789 ; int gx = int(gl_GlobalInvocationID.x);
1790 ; int gy = int(gl_GlobalInvocationID.y);
1791 ; int gz = int(gl_GlobalInvocationID.z);
1792 ; imageAtomicAdd(u_resultImage, ivec3(gx % 48,gy,gz), int(gx*gx + gy*gy + gz*gz));
1797 ; Generator: Khronos Glslang Reference Front End; 7
1801 %1 = OpExtInstImport "GLSL.std.450"
1802 OpMemoryModel Logical GLSL450
1803 OpEntryPoint GLCompute %4 "main" %12
1804 OpExecutionMode %4 LocalSize 1 1 1
1805 OpDecorate %12 BuiltIn GlobalInvocationId
1806 OpDecorate %30 DescriptorSet 0
1807 OpDecorate %30 Binding 0
1808 OpDecorate %30 Coherent
1809 OpDecorate %52 BuiltIn WorkgroupSize
1811 %3 = OpTypeFunction %2
1813 %7 = OpTypePointer Function %6
1815 %10 = OpTypeVector %9 3
1816 %11 = OpTypePointer Input %10
1817 %12 = OpVariable %11 Input
1818 %13 = OpConstant %9 0
1819 %14 = OpTypePointer Input %9
1820 %19 = OpConstant %9 1
1821 %24 = OpConstant %9 2
1822 %28 = OpTypeImage %6 3D 0 0 0 2 R32i
1823 %29 = OpTypePointer UniformConstant %28
1824 %30 = OpVariable %29 UniformConstant
1825 %32 = OpConstant %6 48
1826 %36 = OpTypeVector %6 3
1827 %49 = OpTypePointer Image %6
1828 %52 = OpConstantComposite %10 %19 %19 %19
1829 %4 = OpFunction %2 None %3
1831 %8 = OpVariable %7 Function
1832 %18 = OpVariable %7 Function
1833 %23 = OpVariable %7 Function
1834 %15 = OpAccessChain %14 %12 %13
1836 %17 = OpBitcast %6 %16
1838 %20 = OpAccessChain %14 %12 %19
1840 %22 = OpBitcast %6 %21
1842 %25 = OpAccessChain %14 %12 %24
1844 %27 = OpBitcast %6 %26
1847 %33 = OpSMod %6 %31 %32
1850 %37 = OpCompositeConstruct %36 %33 %34 %35
1853 %40 = OpIMul %6 %38 %39
1856 %43 = OpIMul %6 %41 %42
1857 %44 = OpIAdd %6 %40 %43
1860 %47 = OpIMul %6 %45 %46
1861 %48 = OpIAdd %6 %44 %47
1862 %50 = OpImageTexelPointer %49 %30 %37 %13
1863 %51 = ${OPNAME} %6 %50 %19 %13 ${LASTARG:default=%48}
1868 const std::string kShader_3d_r32i_intermediate_values = R"(
1869 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1870 ; replaced with a template parameter and the last argument for it has been made optional.
1873 ; precision highp iimage3D;
1875 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1876 ; layout (r32i, binding=0) coherent uniform iimage3D u_resultImage;
1877 ; layout (r32i, binding=1) writeonly uniform iimage3D u_intermValuesImage;
1881 ; int gx = int(gl_GlobalInvocationID.x);
1882 ; int gy = int(gl_GlobalInvocationID.y);
1883 ; int gz = int(gl_GlobalInvocationID.z);
1884 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), ivec4(imageAtomicAdd(u_resultImage, ivec3(gx % 48,gy,gz), int(gx*gx + gy*gy + gz*gz))));
1889 ; Generator: Khronos Glslang Reference Front End; 7
1893 %1 = OpExtInstImport "GLSL.std.450"
1894 OpMemoryModel Logical GLSL450
1895 OpEntryPoint GLCompute %4 "main" %12
1896 OpExecutionMode %4 LocalSize 1 1 1
1897 OpDecorate %12 BuiltIn GlobalInvocationId
1898 OpDecorate %30 DescriptorSet 0
1899 OpDecorate %30 Binding 1
1900 OpDecorate %30 NonReadable
1901 OpDecorate %37 DescriptorSet 0
1902 OpDecorate %37 Binding 0
1903 OpDecorate %37 Coherent
1904 OpDecorate %60 BuiltIn WorkgroupSize
1906 %3 = OpTypeFunction %2
1908 %7 = OpTypePointer Function %6
1910 %10 = OpTypeVector %9 3
1911 %11 = OpTypePointer Input %10
1912 %12 = OpVariable %11 Input
1913 %13 = OpConstant %9 0
1914 %14 = OpTypePointer Input %9
1915 %19 = OpConstant %9 1
1916 %24 = OpConstant %9 2
1917 %28 = OpTypeImage %6 3D 0 0 0 2 R32i
1918 %29 = OpTypePointer UniformConstant %28
1919 %30 = OpVariable %29 UniformConstant
1920 %35 = OpTypeVector %6 3
1921 %37 = OpVariable %29 UniformConstant
1922 %39 = OpConstant %6 48
1923 %55 = OpTypePointer Image %6
1924 %58 = OpTypeVector %6 4
1925 %60 = OpConstantComposite %10 %19 %19 %19
1926 %4 = OpFunction %2 None %3
1928 %8 = OpVariable %7 Function
1929 %18 = OpVariable %7 Function
1930 %23 = OpVariable %7 Function
1931 %15 = OpAccessChain %14 %12 %13
1933 %17 = OpBitcast %6 %16
1935 %20 = OpAccessChain %14 %12 %19
1937 %22 = OpBitcast %6 %21
1939 %25 = OpAccessChain %14 %12 %24
1941 %27 = OpBitcast %6 %26
1943 %31 = OpLoad %28 %30
1947 %36 = OpCompositeConstruct %35 %32 %33 %34
1949 %40 = OpSMod %6 %38 %39
1952 %43 = OpCompositeConstruct %35 %40 %41 %42
1955 %46 = OpIMul %6 %44 %45
1958 %49 = OpIMul %6 %47 %48
1959 %50 = OpIAdd %6 %46 %49
1962 %53 = OpIMul %6 %51 %52
1963 %54 = OpIAdd %6 %50 %53
1964 %56 = OpImageTexelPointer %55 %37 %43 %13
1965 %57 = ${OPNAME} %6 %56 %19 %13 ${LASTARG:default=%54}
1966 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
1967 OpImageWrite %31 %36 %59
1972 const std::string kShader_cube_r32ui_end_result = R"(
1973 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
1974 ; replaced with a template parameter and the last argument for it has been made optional.
1977 ; precision highp uimageCube;
1979 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
1980 ; layout (r32ui, binding=0) coherent uniform uimageCube u_resultImage;
1984 ; int gx = int(gl_GlobalInvocationID.x);
1985 ; int gy = int(gl_GlobalInvocationID.y);
1986 ; int gz = int(gl_GlobalInvocationID.z);
1987 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz));
1992 ; Generator: Khronos Glslang Reference Front End; 7
1996 %1 = OpExtInstImport "GLSL.std.450"
1997 OpMemoryModel Logical GLSL450
1998 OpEntryPoint GLCompute %4 "main" %12
1999 OpExecutionMode %4 LocalSize 1 1 1
2000 OpDecorate %12 BuiltIn GlobalInvocationId
2001 OpDecorate %30 DescriptorSet 0
2002 OpDecorate %30 Binding 0
2003 OpDecorate %30 Coherent
2004 OpDecorate %53 BuiltIn WorkgroupSize
2006 %3 = OpTypeFunction %2
2008 %7 = OpTypePointer Function %6
2010 %10 = OpTypeVector %9 3
2011 %11 = OpTypePointer Input %10
2012 %12 = OpVariable %11 Input
2013 %13 = OpConstant %9 0
2014 %14 = OpTypePointer Input %9
2015 %19 = OpConstant %9 1
2016 %24 = OpConstant %9 2
2017 %28 = OpTypeImage %9 Cube 0 0 0 2 R32ui
2018 %29 = OpTypePointer UniformConstant %28
2019 %30 = OpVariable %29 UniformConstant
2020 %32 = OpConstant %6 64
2021 %36 = OpTypeVector %6 3
2022 %50 = OpTypePointer Image %9
2023 %53 = OpConstantComposite %10 %19 %19 %19
2024 %4 = OpFunction %2 None %3
2026 %8 = OpVariable %7 Function
2027 %18 = OpVariable %7 Function
2028 %23 = OpVariable %7 Function
2029 %15 = OpAccessChain %14 %12 %13
2031 %17 = OpBitcast %6 %16
2033 %20 = OpAccessChain %14 %12 %19
2035 %22 = OpBitcast %6 %21
2037 %25 = OpAccessChain %14 %12 %24
2039 %27 = OpBitcast %6 %26
2042 %33 = OpSMod %6 %31 %32
2045 %37 = OpCompositeConstruct %36 %33 %34 %35
2048 %40 = OpIMul %6 %38 %39
2051 %43 = OpIMul %6 %41 %42
2052 %44 = OpIAdd %6 %40 %43
2055 %47 = OpIMul %6 %45 %46
2056 %48 = OpIAdd %6 %44 %47
2057 %49 = OpBitcast %9 %48
2058 %51 = OpImageTexelPointer %50 %30 %37 %13
2059 %52 = ${OPNAME} %9 %51 %19 %13 ${LASTARG:default=%49}
2064 const std::string kShader_cube_r32ui_intermediate_values = R"(
2065 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2066 ; replaced with a template parameter and the last argument for it has been made optional.
2069 ; precision highp uimageCube;
2071 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2072 ; layout (r32ui, binding=0) coherent uniform uimageCube u_resultImage;
2073 ; layout (r32ui, binding=1) writeonly uniform uimageCube u_intermValuesImage;
2077 ; int gx = int(gl_GlobalInvocationID.x);
2078 ; int gy = int(gl_GlobalInvocationID.y);
2079 ; int gz = int(gl_GlobalInvocationID.z);
2080 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), uvec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz))));
2085 ; Generator: Khronos Glslang Reference Front End; 7
2089 %1 = OpExtInstImport "GLSL.std.450"
2090 OpMemoryModel Logical GLSL450
2091 OpEntryPoint GLCompute %4 "main" %12
2092 OpExecutionMode %4 LocalSize 1 1 1
2093 OpDecorate %12 BuiltIn GlobalInvocationId
2094 OpDecorate %30 DescriptorSet 0
2095 OpDecorate %30 Binding 1
2096 OpDecorate %30 NonReadable
2097 OpDecorate %37 DescriptorSet 0
2098 OpDecorate %37 Binding 0
2099 OpDecorate %37 Coherent
2100 OpDecorate %61 BuiltIn WorkgroupSize
2102 %3 = OpTypeFunction %2
2104 %7 = OpTypePointer Function %6
2106 %10 = OpTypeVector %9 3
2107 %11 = OpTypePointer Input %10
2108 %12 = OpVariable %11 Input
2109 %13 = OpConstant %9 0
2110 %14 = OpTypePointer Input %9
2111 %19 = OpConstant %9 1
2112 %24 = OpConstant %9 2
2113 %28 = OpTypeImage %9 Cube 0 0 0 2 R32ui
2114 %29 = OpTypePointer UniformConstant %28
2115 %30 = OpVariable %29 UniformConstant
2116 %35 = OpTypeVector %6 3
2117 %37 = OpVariable %29 UniformConstant
2118 %39 = OpConstant %6 64
2119 %56 = OpTypePointer Image %9
2120 %59 = OpTypeVector %9 4
2121 %61 = OpConstantComposite %10 %19 %19 %19
2122 %4 = OpFunction %2 None %3
2124 %8 = OpVariable %7 Function
2125 %18 = OpVariable %7 Function
2126 %23 = OpVariable %7 Function
2127 %15 = OpAccessChain %14 %12 %13
2129 %17 = OpBitcast %6 %16
2131 %20 = OpAccessChain %14 %12 %19
2133 %22 = OpBitcast %6 %21
2135 %25 = OpAccessChain %14 %12 %24
2137 %27 = OpBitcast %6 %26
2139 %31 = OpLoad %28 %30
2143 %36 = OpCompositeConstruct %35 %32 %33 %34
2145 %40 = OpSMod %6 %38 %39
2148 %43 = OpCompositeConstruct %35 %40 %41 %42
2151 %46 = OpIMul %6 %44 %45
2154 %49 = OpIMul %6 %47 %48
2155 %50 = OpIAdd %6 %46 %49
2158 %53 = OpIMul %6 %51 %52
2159 %54 = OpIAdd %6 %50 %53
2160 %55 = OpBitcast %9 %54
2161 %57 = OpImageTexelPointer %56 %37 %43 %13
2162 %58 = ${OPNAME} %9 %57 %19 %13 ${LASTARG:default=%55}
2163 %60 = OpCompositeConstruct %59 %58 %58 %58 %58
2164 OpImageWrite %31 %36 %60
2169 const std::string kShader_cube_r32i_end_result = R"(
2170 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2171 ; replaced with a template parameter and the last argument for it has been made optional.
2174 ; precision highp iimageCube;
2176 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2177 ; layout (r32i, binding=0) coherent uniform iimageCube u_resultImage;
2181 ; int gx = int(gl_GlobalInvocationID.x);
2182 ; int gy = int(gl_GlobalInvocationID.y);
2183 ; int gz = int(gl_GlobalInvocationID.z);
2184 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz));
2189 ; Generator: Khronos Glslang Reference Front End; 7
2193 %1 = OpExtInstImport "GLSL.std.450"
2194 OpMemoryModel Logical GLSL450
2195 OpEntryPoint GLCompute %4 "main" %12
2196 OpExecutionMode %4 LocalSize 1 1 1
2197 OpDecorate %12 BuiltIn GlobalInvocationId
2198 OpDecorate %30 DescriptorSet 0
2199 OpDecorate %30 Binding 0
2200 OpDecorate %30 Coherent
2201 OpDecorate %52 BuiltIn WorkgroupSize
2203 %3 = OpTypeFunction %2
2205 %7 = OpTypePointer Function %6
2207 %10 = OpTypeVector %9 3
2208 %11 = OpTypePointer Input %10
2209 %12 = OpVariable %11 Input
2210 %13 = OpConstant %9 0
2211 %14 = OpTypePointer Input %9
2212 %19 = OpConstant %9 1
2213 %24 = OpConstant %9 2
2214 %28 = OpTypeImage %6 Cube 0 0 0 2 R32i
2215 %29 = OpTypePointer UniformConstant %28
2216 %30 = OpVariable %29 UniformConstant
2217 %32 = OpConstant %6 64
2218 %36 = OpTypeVector %6 3
2219 %49 = OpTypePointer Image %6
2220 %52 = OpConstantComposite %10 %19 %19 %19
2221 %4 = OpFunction %2 None %3
2223 %8 = OpVariable %7 Function
2224 %18 = OpVariable %7 Function
2225 %23 = OpVariable %7 Function
2226 %15 = OpAccessChain %14 %12 %13
2228 %17 = OpBitcast %6 %16
2230 %20 = OpAccessChain %14 %12 %19
2232 %22 = OpBitcast %6 %21
2234 %25 = OpAccessChain %14 %12 %24
2236 %27 = OpBitcast %6 %26
2239 %33 = OpSMod %6 %31 %32
2242 %37 = OpCompositeConstruct %36 %33 %34 %35
2245 %40 = OpIMul %6 %38 %39
2248 %43 = OpIMul %6 %41 %42
2249 %44 = OpIAdd %6 %40 %43
2252 %47 = OpIMul %6 %45 %46
2253 %48 = OpIAdd %6 %44 %47
2254 %50 = OpImageTexelPointer %49 %30 %37 %13
2255 %51 = ${OPNAME} %6 %50 %19 %13 ${LASTARG:default=%48}
2260 const std::string kShader_cube_r32i_intermediate_values = R"(
2261 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2262 ; replaced with a template parameter and the last argument for it has been made optional.
2265 ; precision highp iimageCube;
2267 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2268 ; layout (r32i, binding=0) coherent uniform iimageCube u_resultImage;
2269 ; layout (r32i, binding=1) writeonly uniform iimageCube u_intermValuesImage;
2273 ; int gx = int(gl_GlobalInvocationID.x);
2274 ; int gy = int(gl_GlobalInvocationID.y);
2275 ; int gz = int(gl_GlobalInvocationID.z);
2276 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), ivec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz))));
2281 ; Generator: Khronos Glslang Reference Front End; 7
2285 %1 = OpExtInstImport "GLSL.std.450"
2286 OpMemoryModel Logical GLSL450
2287 OpEntryPoint GLCompute %4 "main" %12
2288 OpExecutionMode %4 LocalSize 1 1 1
2289 OpDecorate %12 BuiltIn GlobalInvocationId
2290 OpDecorate %30 DescriptorSet 0
2291 OpDecorate %30 Binding 1
2292 OpDecorate %30 NonReadable
2293 OpDecorate %37 DescriptorSet 0
2294 OpDecorate %37 Binding 0
2295 OpDecorate %37 Coherent
2296 OpDecorate %60 BuiltIn WorkgroupSize
2298 %3 = OpTypeFunction %2
2300 %7 = OpTypePointer Function %6
2302 %10 = OpTypeVector %9 3
2303 %11 = OpTypePointer Input %10
2304 %12 = OpVariable %11 Input
2305 %13 = OpConstant %9 0
2306 %14 = OpTypePointer Input %9
2307 %19 = OpConstant %9 1
2308 %24 = OpConstant %9 2
2309 %28 = OpTypeImage %6 Cube 0 0 0 2 R32i
2310 %29 = OpTypePointer UniformConstant %28
2311 %30 = OpVariable %29 UniformConstant
2312 %35 = OpTypeVector %6 3
2313 %37 = OpVariable %29 UniformConstant
2314 %39 = OpConstant %6 64
2315 %55 = OpTypePointer Image %6
2316 %58 = OpTypeVector %6 4
2317 %60 = OpConstantComposite %10 %19 %19 %19
2318 %4 = OpFunction %2 None %3
2320 %8 = OpVariable %7 Function
2321 %18 = OpVariable %7 Function
2322 %23 = OpVariable %7 Function
2323 %15 = OpAccessChain %14 %12 %13
2325 %17 = OpBitcast %6 %16
2327 %20 = OpAccessChain %14 %12 %19
2329 %22 = OpBitcast %6 %21
2331 %25 = OpAccessChain %14 %12 %24
2333 %27 = OpBitcast %6 %26
2335 %31 = OpLoad %28 %30
2339 %36 = OpCompositeConstruct %35 %32 %33 %34
2341 %40 = OpSMod %6 %38 %39
2344 %43 = OpCompositeConstruct %35 %40 %41 %42
2347 %46 = OpIMul %6 %44 %45
2350 %49 = OpIMul %6 %47 %48
2351 %50 = OpIAdd %6 %46 %49
2354 %53 = OpIMul %6 %51 %52
2355 %54 = OpIAdd %6 %50 %53
2356 %56 = OpImageTexelPointer %55 %37 %43 %13
2357 %57 = ${OPNAME} %6 %56 %19 %13 ${LASTARG:default=%54}
2358 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
2359 OpImageWrite %31 %36 %59
2364 const std::string kShader_cube_array_r32ui_end_result = R"(
2365 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2366 ; replaced with a template parameter and the last argument for it has been made optional.
2369 ; precision highp uimageCubeArray;
2371 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2372 ; layout (r32ui, binding=0) coherent uniform uimageCubeArray u_resultImage;
2376 ; int gx = int(gl_GlobalInvocationID.x);
2377 ; int gy = int(gl_GlobalInvocationID.y);
2378 ; int gz = int(gl_GlobalInvocationID.z);
2379 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz));
2384 ; Generator: Khronos Glslang Reference Front End; 7
2388 OpCapability ImageCubeArray
2389 %1 = OpExtInstImport "GLSL.std.450"
2390 OpMemoryModel Logical GLSL450
2391 OpEntryPoint GLCompute %4 "main" %12
2392 OpExecutionMode %4 LocalSize 1 1 1
2393 OpDecorate %12 BuiltIn GlobalInvocationId
2394 OpDecorate %30 DescriptorSet 0
2395 OpDecorate %30 Binding 0
2396 OpDecorate %30 Coherent
2397 OpDecorate %53 BuiltIn WorkgroupSize
2399 %3 = OpTypeFunction %2
2401 %7 = OpTypePointer Function %6
2403 %10 = OpTypeVector %9 3
2404 %11 = OpTypePointer Input %10
2405 %12 = OpVariable %11 Input
2406 %13 = OpConstant %9 0
2407 %14 = OpTypePointer Input %9
2408 %19 = OpConstant %9 1
2409 %24 = OpConstant %9 2
2410 %28 = OpTypeImage %9 Cube 0 1 0 2 R32ui
2411 %29 = OpTypePointer UniformConstant %28
2412 %30 = OpVariable %29 UniformConstant
2413 %32 = OpConstant %6 64
2414 %36 = OpTypeVector %6 3
2415 %50 = OpTypePointer Image %9
2416 %53 = OpConstantComposite %10 %19 %19 %19
2417 %4 = OpFunction %2 None %3
2419 %8 = OpVariable %7 Function
2420 %18 = OpVariable %7 Function
2421 %23 = OpVariable %7 Function
2422 %15 = OpAccessChain %14 %12 %13
2424 %17 = OpBitcast %6 %16
2426 %20 = OpAccessChain %14 %12 %19
2428 %22 = OpBitcast %6 %21
2430 %25 = OpAccessChain %14 %12 %24
2432 %27 = OpBitcast %6 %26
2435 %33 = OpSMod %6 %31 %32
2438 %37 = OpCompositeConstruct %36 %33 %34 %35
2441 %40 = OpIMul %6 %38 %39
2444 %43 = OpIMul %6 %41 %42
2445 %44 = OpIAdd %6 %40 %43
2448 %47 = OpIMul %6 %45 %46
2449 %48 = OpIAdd %6 %44 %47
2450 %49 = OpBitcast %9 %48
2451 %51 = OpImageTexelPointer %50 %30 %37 %13
2452 %52 = ${OPNAME} %9 %51 %19 %13 ${LASTARG:default=%49}
2457 const std::string kShader_cube_array_r32ui_intermediate_values = R"(
2458 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2459 ; replaced with a template parameter and the last argument for it has been made optional.
2462 ; precision highp uimageCubeArray;
2464 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2465 ; layout (r32ui, binding=0) coherent uniform uimageCubeArray u_resultImage;
2466 ; layout (r32ui, binding=1) writeonly uniform uimageCubeArray u_intermValuesImage;
2470 ; int gx = int(gl_GlobalInvocationID.x);
2471 ; int gy = int(gl_GlobalInvocationID.y);
2472 ; int gz = int(gl_GlobalInvocationID.z);
2473 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), uvec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), uint(gx*gx + gy*gy + gz*gz))));
2478 ; Generator: Khronos Glslang Reference Front End; 7
2482 OpCapability ImageCubeArray
2483 %1 = OpExtInstImport "GLSL.std.450"
2484 OpMemoryModel Logical GLSL450
2485 OpEntryPoint GLCompute %4 "main" %12
2486 OpExecutionMode %4 LocalSize 1 1 1
2487 OpDecorate %12 BuiltIn GlobalInvocationId
2488 OpDecorate %30 DescriptorSet 0
2489 OpDecorate %30 Binding 1
2490 OpDecorate %30 NonReadable
2491 OpDecorate %37 DescriptorSet 0
2492 OpDecorate %37 Binding 0
2493 OpDecorate %37 Coherent
2494 OpDecorate %61 BuiltIn WorkgroupSize
2496 %3 = OpTypeFunction %2
2498 %7 = OpTypePointer Function %6
2500 %10 = OpTypeVector %9 3
2501 %11 = OpTypePointer Input %10
2502 %12 = OpVariable %11 Input
2503 %13 = OpConstant %9 0
2504 %14 = OpTypePointer Input %9
2505 %19 = OpConstant %9 1
2506 %24 = OpConstant %9 2
2507 %28 = OpTypeImage %9 Cube 0 1 0 2 R32ui
2508 %29 = OpTypePointer UniformConstant %28
2509 %30 = OpVariable %29 UniformConstant
2510 %35 = OpTypeVector %6 3
2511 %37 = OpVariable %29 UniformConstant
2512 %39 = OpConstant %6 64
2513 %56 = OpTypePointer Image %9
2514 %59 = OpTypeVector %9 4
2515 %61 = OpConstantComposite %10 %19 %19 %19
2516 %4 = OpFunction %2 None %3
2518 %8 = OpVariable %7 Function
2519 %18 = OpVariable %7 Function
2520 %23 = OpVariable %7 Function
2521 %15 = OpAccessChain %14 %12 %13
2523 %17 = OpBitcast %6 %16
2525 %20 = OpAccessChain %14 %12 %19
2527 %22 = OpBitcast %6 %21
2529 %25 = OpAccessChain %14 %12 %24
2531 %27 = OpBitcast %6 %26
2533 %31 = OpLoad %28 %30
2537 %36 = OpCompositeConstruct %35 %32 %33 %34
2539 %40 = OpSMod %6 %38 %39
2542 %43 = OpCompositeConstruct %35 %40 %41 %42
2545 %46 = OpIMul %6 %44 %45
2548 %49 = OpIMul %6 %47 %48
2549 %50 = OpIAdd %6 %46 %49
2552 %53 = OpIMul %6 %51 %52
2553 %54 = OpIAdd %6 %50 %53
2554 %55 = OpBitcast %9 %54
2555 %57 = OpImageTexelPointer %56 %37 %43 %13
2556 %58 = ${OPNAME} %9 %57 %19 %13 ${LASTARG:default=%55}
2557 %60 = OpCompositeConstruct %59 %58 %58 %58 %58
2558 OpImageWrite %31 %36 %60
2563 const std::string kShader_cube_array_r32i_end_result = R"(
2564 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2565 ; replaced with a template parameter and the last argument for it has been made optional.
2568 ; precision highp iimageCubeArray;
2570 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2571 ; layout (r32i, binding=0) coherent uniform iimageCubeArray u_resultImage;
2575 ; int gx = int(gl_GlobalInvocationID.x);
2576 ; int gy = int(gl_GlobalInvocationID.y);
2577 ; int gz = int(gl_GlobalInvocationID.z);
2578 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz));
2583 ; Generator: Khronos Glslang Reference Front End; 7
2587 OpCapability ImageCubeArray
2588 %1 = OpExtInstImport "GLSL.std.450"
2589 OpMemoryModel Logical GLSL450
2590 OpEntryPoint GLCompute %4 "main" %12
2591 OpExecutionMode %4 LocalSize 1 1 1
2592 OpDecorate %12 BuiltIn GlobalInvocationId
2593 OpDecorate %30 DescriptorSet 0
2594 OpDecorate %30 Binding 0
2595 OpDecorate %30 Coherent
2596 OpDecorate %52 BuiltIn WorkgroupSize
2598 %3 = OpTypeFunction %2
2600 %7 = OpTypePointer Function %6
2602 %10 = OpTypeVector %9 3
2603 %11 = OpTypePointer Input %10
2604 %12 = OpVariable %11 Input
2605 %13 = OpConstant %9 0
2606 %14 = OpTypePointer Input %9
2607 %19 = OpConstant %9 1
2608 %24 = OpConstant %9 2
2609 %28 = OpTypeImage %6 Cube 0 1 0 2 R32i
2610 %29 = OpTypePointer UniformConstant %28
2611 %30 = OpVariable %29 UniformConstant
2612 %32 = OpConstant %6 64
2613 %36 = OpTypeVector %6 3
2614 %49 = OpTypePointer Image %6
2615 %52 = OpConstantComposite %10 %19 %19 %19
2616 %4 = OpFunction %2 None %3
2618 %8 = OpVariable %7 Function
2619 %18 = OpVariable %7 Function
2620 %23 = OpVariable %7 Function
2621 %15 = OpAccessChain %14 %12 %13
2623 %17 = OpBitcast %6 %16
2625 %20 = OpAccessChain %14 %12 %19
2627 %22 = OpBitcast %6 %21
2629 %25 = OpAccessChain %14 %12 %24
2631 %27 = OpBitcast %6 %26
2634 %33 = OpSMod %6 %31 %32
2637 %37 = OpCompositeConstruct %36 %33 %34 %35
2640 %40 = OpIMul %6 %38 %39
2643 %43 = OpIMul %6 %41 %42
2644 %44 = OpIAdd %6 %40 %43
2647 %47 = OpIMul %6 %45 %46
2648 %48 = OpIAdd %6 %44 %47
2649 %50 = OpImageTexelPointer %49 %30 %37 %13
2650 %51 = ${OPNAME} %6 %50 %19 %13 ${LASTARG:default=%48}
2655 const std::string kShader_cube_array_r32i_intermediate_values = R"(
2656 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2657 ; replaced with a template parameter and the last argument for it has been made optional.
2660 ; precision highp iimageCubeArray;
2662 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2663 ; layout (r32i, binding=0) coherent uniform iimageCubeArray u_resultImage;
2664 ; layout (r32i, binding=1) writeonly uniform iimageCubeArray u_intermValuesImage;
2668 ; int gx = int(gl_GlobalInvocationID.x);
2669 ; int gy = int(gl_GlobalInvocationID.y);
2670 ; int gz = int(gl_GlobalInvocationID.z);
2671 ; imageStore(u_intermValuesImage, ivec3(gx,gy,gz), ivec4(imageAtomicAdd(u_resultImage, ivec3(gx % 64,gy,gz), int(gx*gx + gy*gy + gz*gz))));
2676 ; Generator: Khronos Glslang Reference Front End; 7
2680 OpCapability ImageCubeArray
2681 %1 = OpExtInstImport "GLSL.std.450"
2682 OpMemoryModel Logical GLSL450
2683 OpEntryPoint GLCompute %4 "main" %12
2684 OpExecutionMode %4 LocalSize 1 1 1
2685 OpDecorate %12 BuiltIn GlobalInvocationId
2686 OpDecorate %30 DescriptorSet 0
2687 OpDecorate %30 Binding 1
2688 OpDecorate %30 NonReadable
2689 OpDecorate %37 DescriptorSet 0
2690 OpDecorate %37 Binding 0
2691 OpDecorate %37 Coherent
2692 OpDecorate %60 BuiltIn WorkgroupSize
2694 %3 = OpTypeFunction %2
2696 %7 = OpTypePointer Function %6
2698 %10 = OpTypeVector %9 3
2699 %11 = OpTypePointer Input %10
2700 %12 = OpVariable %11 Input
2701 %13 = OpConstant %9 0
2702 %14 = OpTypePointer Input %9
2703 %19 = OpConstant %9 1
2704 %24 = OpConstant %9 2
2705 %28 = OpTypeImage %6 Cube 0 1 0 2 R32i
2706 %29 = OpTypePointer UniformConstant %28
2707 %30 = OpVariable %29 UniformConstant
2708 %35 = OpTypeVector %6 3
2709 %37 = OpVariable %29 UniformConstant
2710 %39 = OpConstant %6 64
2711 %55 = OpTypePointer Image %6
2712 %58 = OpTypeVector %6 4
2713 %60 = OpConstantComposite %10 %19 %19 %19
2714 %4 = OpFunction %2 None %3
2716 %8 = OpVariable %7 Function
2717 %18 = OpVariable %7 Function
2718 %23 = OpVariable %7 Function
2719 %15 = OpAccessChain %14 %12 %13
2721 %17 = OpBitcast %6 %16
2723 %20 = OpAccessChain %14 %12 %19
2725 %22 = OpBitcast %6 %21
2727 %25 = OpAccessChain %14 %12 %24
2729 %27 = OpBitcast %6 %26
2731 %31 = OpLoad %28 %30
2735 %36 = OpCompositeConstruct %35 %32 %33 %34
2737 %40 = OpSMod %6 %38 %39
2740 %43 = OpCompositeConstruct %35 %40 %41 %42
2743 %46 = OpIMul %6 %44 %45
2746 %49 = OpIMul %6 %47 %48
2747 %50 = OpIAdd %6 %46 %49
2750 %53 = OpIMul %6 %51 %52
2751 %54 = OpIAdd %6 %50 %53
2752 %56 = OpImageTexelPointer %55 %37 %43 %13
2753 %57 = ${OPNAME} %6 %56 %19 %13 ${LASTARG:default=%54}
2754 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
2755 OpImageWrite %31 %36 %59
2760 const std::string kShader_image_buffer_r32ui_end_result = R"(
2761 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2762 ; replaced with a template parameter and the last argument for it has been made optional.
2765 ;precision highp uimageBuffer;
2767 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2768 ;layout (r32ui, binding=0) coherent uniform uimageBuffer u_resultImage;
2772 ; int gx = int(gl_GlobalInvocationID.x);
2773 ; int gy = int(gl_GlobalInvocationID.y);
2774 ; int gz = int(gl_GlobalInvocationID.z);
2775 ; imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz));
2780 ; Generator: Khronos Glslang Reference Front End; 8
2784 OpCapability ImageBuffer
2785 %1 = OpExtInstImport "GLSL.std.450"
2786 OpMemoryModel Logical GLSL450
2787 OpEntryPoint GLCompute %4 "main" %12
2788 OpExecutionMode %4 LocalSize 1 1 1
2789 OpDecorate %12 BuiltIn GlobalInvocationId
2790 OpDecorate %30 DescriptorSet 0
2791 OpDecorate %30 Binding 0
2792 OpDecorate %30 Coherent
2793 OpDecorate %49 BuiltIn WorkgroupSize
2795 %3 = OpTypeFunction %2
2797 %7 = OpTypePointer Function %6
2799 %10 = OpTypeVector %9 3
2800 %11 = OpTypePointer Input %10
2801 %12 = OpVariable %11 Input
2802 %13 = OpConstant %9 0
2803 %14 = OpTypePointer Input %9
2804 %19 = OpConstant %9 1
2805 %24 = OpConstant %9 2
2806 %28 = OpTypeImage %9 Buffer 0 0 0 2 R32ui
2807 %29 = OpTypePointer UniformConstant %28
2808 %30 = OpVariable %29 UniformConstant
2809 %32 = OpConstant %6 64
2810 %46 = OpTypePointer Image %9
2811 %49 = OpConstantComposite %10 %19 %19 %19
2812 %4 = OpFunction %2 None %3
2814 %8 = OpVariable %7 Function
2815 %18 = OpVariable %7 Function
2816 %23 = OpVariable %7 Function
2817 %15 = OpAccessChain %14 %12 %13
2819 %17 = OpBitcast %6 %16
2821 %20 = OpAccessChain %14 %12 %19
2823 %22 = OpBitcast %6 %21
2825 %25 = OpAccessChain %14 %12 %24
2827 %27 = OpBitcast %6 %26
2830 %33 = OpSMod %6 %31 %32
2833 %36 = OpIMul %6 %34 %35
2836 %39 = OpIMul %6 %37 %38
2837 %40 = OpIAdd %6 %36 %39
2840 %43 = OpIMul %6 %41 %42
2841 %44 = OpIAdd %6 %40 %43
2842 %45 = OpBitcast %9 %44
2843 %47 = OpImageTexelPointer %46 %30 %33 %13
2844 %48 = ${OPNAME} %9 %47 %19 %13 ${LASTARG:default=%45}
2849 const std::string kShader_image_buffer_r32ui_intermediate_values = R"(
2850 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2851 ; replaced with a template parameter and the last argument for it has been made optional.
2854 ;precision highp uimageBuffer;
2856 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2857 ;layout (r32ui, binding=0) coherent uniform uimageBuffer u_resultImage;
2858 ;layout (r32ui, binding=1) writeonly uniform uimageBuffer u_intermValuesImage;
2862 ; int gx = int(gl_GlobalInvocationID.x);
2863 ; int gy = int(gl_GlobalInvocationID.y);
2864 ; int gz = int(gl_GlobalInvocationID.z);
2865 ; imageStore(u_intermValuesImage, gx, uvec4(imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz))));
2870 ; Generator: Khronos Glslang Reference Front End; 8
2874 OpCapability ImageBuffer
2875 %1 = OpExtInstImport "GLSL.std.450"
2876 OpMemoryModel Logical GLSL450
2877 OpEntryPoint GLCompute %4 "main" %12
2878 OpExecutionMode %4 LocalSize 1 1 1
2879 OpDecorate %12 BuiltIn GlobalInvocationId
2880 OpDecorate %30 DescriptorSet 0
2881 OpDecorate %30 Binding 1
2882 OpDecorate %30 NonReadable
2883 OpDecorate %33 DescriptorSet 0
2884 OpDecorate %33 Binding 0
2885 OpDecorate %33 Coherent
2886 OpDecorate %54 BuiltIn WorkgroupSize
2888 %3 = OpTypeFunction %2
2890 %7 = OpTypePointer Function %6
2892 %10 = OpTypeVector %9 3
2893 %11 = OpTypePointer Input %10
2894 %12 = OpVariable %11 Input
2895 %13 = OpConstant %9 0
2896 %14 = OpTypePointer Input %9
2897 %19 = OpConstant %9 1
2898 %24 = OpConstant %9 2
2899 %28 = OpTypeImage %9 Buffer 0 0 0 2 R32ui
2900 %29 = OpTypePointer UniformConstant %28
2901 %30 = OpVariable %29 UniformConstant
2902 %33 = OpVariable %29 UniformConstant
2903 %35 = OpConstant %6 64
2904 %49 = OpTypePointer Image %9
2905 %52 = OpTypeVector %9 4
2906 %54 = OpConstantComposite %10 %19 %19 %19
2907 %4 = OpFunction %2 None %3
2909 %8 = OpVariable %7 Function
2910 %18 = OpVariable %7 Function
2911 %23 = OpVariable %7 Function
2912 %15 = OpAccessChain %14 %12 %13
2914 %17 = OpBitcast %6 %16
2916 %20 = OpAccessChain %14 %12 %19
2918 %22 = OpBitcast %6 %21
2920 %25 = OpAccessChain %14 %12 %24
2922 %27 = OpBitcast %6 %26
2924 %31 = OpLoad %28 %30
2927 %36 = OpSMod %6 %34 %35
2930 %39 = OpIMul %6 %37 %38
2933 %42 = OpIMul %6 %40 %41
2934 %43 = OpIAdd %6 %39 %42
2937 %46 = OpIMul %6 %44 %45
2938 %47 = OpIAdd %6 %43 %46
2939 %48 = OpBitcast %9 %47
2940 %50 = OpImageTexelPointer %49 %33 %36 %13
2941 %51 = ${OPNAME} %9 %50 %19 %13 ${LASTARG:default=%48}
2942 %53 = OpCompositeConstruct %52 %51 %51 %51 %51
2943 OpImageWrite %31 %32 %53
2948 const std::string kShader_image_buffer_r32i_end_result = R"(
2949 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
2950 ; replaced with a template parameter and the last argument for it has been made optional.
2953 ;precision highp iimageBuffer;
2955 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
2956 ;layout (r32i, binding=0) coherent uniform iimageBuffer u_resultImage;
2960 ; int gx = int(gl_GlobalInvocationID.x);
2961 ; int gy = int(gl_GlobalInvocationID.y);
2962 ; int gz = int(gl_GlobalInvocationID.z);
2963 ; imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz));
2968 ; Generator: Khronos Glslang Reference Front End; 8
2972 OpCapability ImageBuffer
2973 %1 = OpExtInstImport "GLSL.std.450"
2974 OpMemoryModel Logical GLSL450
2975 OpEntryPoint GLCompute %4 "main" %12
2976 OpExecutionMode %4 LocalSize 1 1 1
2977 OpDecorate %12 BuiltIn GlobalInvocationId
2978 OpDecorate %30 DescriptorSet 0
2979 OpDecorate %30 Binding 0
2980 OpDecorate %30 Coherent
2981 OpDecorate %48 BuiltIn WorkgroupSize
2983 %3 = OpTypeFunction %2
2985 %7 = OpTypePointer Function %6
2987 %10 = OpTypeVector %9 3
2988 %11 = OpTypePointer Input %10
2989 %12 = OpVariable %11 Input
2990 %13 = OpConstant %9 0
2991 %14 = OpTypePointer Input %9
2992 %19 = OpConstant %9 1
2993 %24 = OpConstant %9 2
2994 %28 = OpTypeImage %6 Buffer 0 0 0 2 R32i
2995 %29 = OpTypePointer UniformConstant %28
2996 %30 = OpVariable %29 UniformConstant
2997 %32 = OpConstant %6 64
2998 %45 = OpTypePointer Image %6
2999 %48 = OpConstantComposite %10 %19 %19 %19
3000 %4 = OpFunction %2 None %3
3002 %8 = OpVariable %7 Function
3003 %18 = OpVariable %7 Function
3004 %23 = OpVariable %7 Function
3005 %15 = OpAccessChain %14 %12 %13
3007 %17 = OpBitcast %6 %16
3009 %20 = OpAccessChain %14 %12 %19
3011 %22 = OpBitcast %6 %21
3013 %25 = OpAccessChain %14 %12 %24
3015 %27 = OpBitcast %6 %26
3018 %33 = OpSMod %6 %31 %32
3021 %36 = OpIMul %6 %34 %35
3024 %39 = OpIMul %6 %37 %38
3025 %40 = OpIAdd %6 %36 %39
3028 %43 = OpIMul %6 %41 %42
3029 %44 = OpIAdd %6 %40 %43
3030 %46 = OpImageTexelPointer %45 %30 %33 %13
3031 %47 = ${OPNAME} %6 %46 %19 %13 ${LASTARG:default=%44}
3036 const std::string kShader_image_buffer_r32i_intermediate_values = R"(
3037 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3038 ; replaced with a template parameter and the last argument for it has been made optional.
3041 ;precision highp iimageBuffer;
3043 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3044 ;layout (r32i, binding=0) coherent uniform iimageBuffer u_resultImage;
3045 ;layout (r32i, binding=1) writeonly uniform iimageBuffer u_intermValuesImage;
3049 ; int gx = int(gl_GlobalInvocationID.x);
3050 ; int gy = int(gl_GlobalInvocationID.y);
3051 ; int gz = int(gl_GlobalInvocationID.z);
3052 ; imageStore(u_intermValuesImage, gx, ivec4(imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz))));
3057 ; Generator: Khronos Glslang Reference Front End; 8
3061 OpCapability ImageBuffer
3062 %1 = OpExtInstImport "GLSL.std.450"
3063 OpMemoryModel Logical GLSL450
3064 OpEntryPoint GLCompute %4 "main" %12
3065 OpExecutionMode %4 LocalSize 1 1 1
3066 OpDecorate %12 BuiltIn GlobalInvocationId
3067 OpDecorate %30 DescriptorSet 0
3068 OpDecorate %30 Binding 1
3069 OpDecorate %30 NonReadable
3070 OpDecorate %33 DescriptorSet 0
3071 OpDecorate %33 Binding 0
3072 OpDecorate %33 Coherent
3073 OpDecorate %53 BuiltIn WorkgroupSize
3075 %3 = OpTypeFunction %2
3077 %7 = OpTypePointer Function %6
3079 %10 = OpTypeVector %9 3
3080 %11 = OpTypePointer Input %10
3081 %12 = OpVariable %11 Input
3082 %13 = OpConstant %9 0
3083 %14 = OpTypePointer Input %9
3084 %19 = OpConstant %9 1
3085 %24 = OpConstant %9 2
3086 %28 = OpTypeImage %6 Buffer 0 0 0 2 R32i
3087 %29 = OpTypePointer UniformConstant %28
3088 %30 = OpVariable %29 UniformConstant
3089 %33 = OpVariable %29 UniformConstant
3090 %35 = OpConstant %6 64
3091 %48 = OpTypePointer Image %6
3092 %51 = OpTypeVector %6 4
3093 %53 = OpConstantComposite %10 %19 %19 %19
3094 %4 = OpFunction %2 None %3
3096 %8 = OpVariable %7 Function
3097 %18 = OpVariable %7 Function
3098 %23 = OpVariable %7 Function
3099 %15 = OpAccessChain %14 %12 %13
3101 %17 = OpBitcast %6 %16
3103 %20 = OpAccessChain %14 %12 %19
3105 %22 = OpBitcast %6 %21
3107 %25 = OpAccessChain %14 %12 %24
3109 %27 = OpBitcast %6 %26
3111 %31 = OpLoad %28 %30
3114 %36 = OpSMod %6 %34 %35
3117 %39 = OpIMul %6 %37 %38
3120 %42 = OpIMul %6 %40 %41
3121 %43 = OpIAdd %6 %39 %42
3124 %46 = OpIMul %6 %44 %45
3125 %47 = OpIAdd %6 %43 %46
3126 %49 = OpImageTexelPointer %48 %33 %36 %13
3127 %50 = ${OPNAME} %6 %49 %19 %13 ${LASTARG:default=%47}
3128 %52 = OpCompositeConstruct %51 %50 %50 %50 %50
3129 OpImageWrite %31 %32 %52
3134 const std::string kShader_1d_r64ui_end_result = R"(
3135 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3136 ; replaced with a template parameter and the last argument for it has been made optional.
3139 ; precision highp uimage1D;
3141 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3142 ; #extension GL_EXT_shader_image_int64 : require
3144 ; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3145 ; layout(r64ui, binding = 0) coherent uniform uimage1D u_resultImage;
3148 ; int gx = int(gl_GlobalInvocationID.x);
3149 ; int gy = int(gl_GlobalInvocationID.y);
3150 ; int gz = int(gl_GlobalInvocationID.z);
3151 ; imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz));
3156 ; Generator: Khronos Glslang Reference Front End; 8
3161 OpCapability Int64Atomics
3162 OpCapability Image1D
3163 OpCapability Int64ImageEXT
3164 OpExtension "SPV_EXT_shader_image_int64"
3165 %1 = OpExtInstImport "GLSL.std.450"
3166 OpMemoryModel Logical GLSL450
3167 OpEntryPoint GLCompute %4 "main" %12
3168 OpExecutionMode %4 LocalSize 1 1 1
3169 OpDecorate %12 BuiltIn GlobalInvocationId
3170 OpDecorate %31 DescriptorSet 0
3171 OpDecorate %31 Binding 0
3172 OpDecorate %31 Coherent
3173 OpDecorate %52 BuiltIn WorkgroupSize
3175 %3 = OpTypeFunction %2
3177 %7 = OpTypePointer Function %6
3179 %10 = OpTypeVector %9 3
3180 %11 = OpTypePointer Input %10
3181 %12 = OpVariable %11 Input
3182 %13 = OpConstant %9 0
3183 %14 = OpTypePointer Input %9
3184 %19 = OpConstant %9 1
3185 %24 = OpConstant %9 2
3186 %28 = OpTypeInt 64 0
3187 %29 = OpTypeImage %28 1D 0 0 0 2 R64ui
3188 %30 = OpTypePointer UniformConstant %29
3189 %31 = OpVariable %30 UniformConstant
3190 %33 = OpConstant %6 64
3191 %46 = OpTypeInt 64 1
3192 %49 = OpTypePointer Image %28
3193 %52 = OpConstantComposite %10 %19 %19 %19
3194 %4 = OpFunction %2 None %3
3196 %8 = OpVariable %7 Function
3197 %18 = OpVariable %7 Function
3198 %23 = OpVariable %7 Function
3199 %15 = OpAccessChain %14 %12 %13
3201 %17 = OpBitcast %6 %16
3203 %20 = OpAccessChain %14 %12 %19
3205 %22 = OpBitcast %6 %21
3207 %25 = OpAccessChain %14 %12 %24
3209 %27 = OpBitcast %6 %26
3212 %34 = OpSMod %6 %32 %33
3215 %37 = OpIMul %6 %35 %36
3218 %40 = OpIMul %6 %38 %39
3219 %41 = OpIAdd %6 %37 %40
3222 %44 = OpIMul %6 %42 %43
3223 %45 = OpIAdd %6 %41 %44
3224 %47 = OpSConvert %46 %45
3225 %48 = OpBitcast %28 %47
3226 %50 = OpImageTexelPointer %49 %31 %34 %13
3227 %51 = ${OPNAME} %28 %50 %19 %13 ${LASTARG:default=%48}
3232 const std::string kShader_1d_r64ui_intermediate_values = R"(
3233 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3234 ; replaced with a template parameter and the last argument for it has been made optional.
3237 ; precision highp uimage1D;
3238 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3239 ; #extension GL_EXT_shader_image_int64 : require
3241 ; layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3242 ; layout(r64ui, binding = 0) coherent uniform uimage1D u_resultImage;
3243 ; layout(r64ui, binding = 1) writeonly uniform uimage1D u_intermValuesImage;
3247 ; int gx = int(gl_GlobalInvocationID.x);
3248 ; int gy = int(gl_GlobalInvocationID.y);
3249 ; int gz = int(gl_GlobalInvocationID.z);
3250 ; imageStore(u_intermValuesImage, gx, u64vec4(imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz))));
3255 ; Generator: Khronos Glslang Reference Front End; 8
3260 OpCapability Int64Atomics
3261 OpCapability Image1D
3262 OpCapability Int64ImageEXT
3263 OpExtension "SPV_EXT_shader_image_int64"
3264 %1 = OpExtInstImport "GLSL.std.450"
3265 OpMemoryModel Logical GLSL450
3266 OpEntryPoint GLCompute %4 "main" %12
3267 OpExecutionMode %4 LocalSize 1 1 1
3268 OpDecorate %12 BuiltIn GlobalInvocationId
3269 OpDecorate %31 DescriptorSet 0
3270 OpDecorate %31 Binding 1
3271 OpDecorate %31 NonReadable
3272 OpDecorate %34 DescriptorSet 0
3273 OpDecorate %34 Binding 0
3274 OpDecorate %34 Coherent
3275 OpDecorate %57 BuiltIn WorkgroupSize
3277 %3 = OpTypeFunction %2
3279 %7 = OpTypePointer Function %6
3281 %10 = OpTypeVector %9 3
3282 %11 = OpTypePointer Input %10
3283 %12 = OpVariable %11 Input
3284 %13 = OpConstant %9 0
3285 %14 = OpTypePointer Input %9
3286 %19 = OpConstant %9 1
3287 %24 = OpConstant %9 2
3288 %28 = OpTypeInt 64 0
3289 %29 = OpTypeImage %28 1D 0 0 0 2 R64ui
3290 %30 = OpTypePointer UniformConstant %29
3291 %31 = OpVariable %30 UniformConstant
3292 %34 = OpVariable %30 UniformConstant
3293 %36 = OpConstant %6 64
3294 %49 = OpTypeInt 64 1
3295 %52 = OpTypePointer Image %28
3296 %55 = OpTypeVector %28 4
3297 %57 = OpConstantComposite %10 %19 %19 %19
3298 %4 = OpFunction %2 None %3
3300 %8 = OpVariable %7 Function
3301 %18 = OpVariable %7 Function
3302 %23 = OpVariable %7 Function
3303 %15 = OpAccessChain %14 %12 %13
3305 %17 = OpBitcast %6 %16
3307 %20 = OpAccessChain %14 %12 %19
3309 %22 = OpBitcast %6 %21
3311 %25 = OpAccessChain %14 %12 %24
3313 %27 = OpBitcast %6 %26
3315 %32 = OpLoad %29 %31
3318 %37 = OpSMod %6 %35 %36
3321 %40 = OpIMul %6 %38 %39
3324 %43 = OpIMul %6 %41 %42
3325 %44 = OpIAdd %6 %40 %43
3328 %47 = OpIMul %6 %45 %46
3329 %48 = OpIAdd %6 %44 %47
3330 %50 = OpSConvert %49 %48
3331 %51 = OpBitcast %28 %50
3332 %53 = OpImageTexelPointer %52 %34 %37 %13
3333 %54 = ${OPNAME} %28 %53 %19 %13 ${LASTARG:default=%51}
3334 %56 = OpCompositeConstruct %55 %54 %54 %54 %54
3335 OpImageWrite %32 %33 %56
3340 const std::string kShader_1d_r64i_end_result = R"(
3341 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3342 ; replaced with a template parameter and the last argument for it has been made optional.
3345 ;precision highp iimage1D;
3346 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3347 ;#extension GL_EXT_shader_image_int64 : require
3349 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3350 ;layout (r64i, binding=0) coherent uniform iimage1D u_resultImage;
3354 ; int gx = int(gl_GlobalInvocationID.x);
3355 ; int gy = int(gl_GlobalInvocationID.y);
3356 ; int gz = int(gl_GlobalInvocationID.z);
3357 ; imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz));
3362 ; Generator: Khronos Glslang Reference Front End; 8
3367 OpCapability Int64Atomics
3368 OpCapability Image1D
3369 OpCapability Int64ImageEXT
3370 OpExtension "SPV_EXT_shader_image_int64"
3371 %1 = OpExtInstImport "GLSL.std.450"
3372 OpMemoryModel Logical GLSL450
3373 OpEntryPoint GLCompute %4 "main" %12
3374 OpExecutionMode %4 LocalSize 1 1 1
3375 OpDecorate %12 BuiltIn GlobalInvocationId
3376 OpDecorate %31 DescriptorSet 0
3377 OpDecorate %31 Binding 0
3378 OpDecorate %31 Coherent
3379 OpDecorate %50 BuiltIn WorkgroupSize
3381 %3 = OpTypeFunction %2
3383 %7 = OpTypePointer Function %6
3385 %10 = OpTypeVector %9 3
3386 %11 = OpTypePointer Input %10
3387 %12 = OpVariable %11 Input
3388 %13 = OpConstant %9 0
3389 %14 = OpTypePointer Input %9
3390 %19 = OpConstant %9 1
3391 %24 = OpConstant %9 2
3392 %28 = OpTypeInt 64 1
3393 %29 = OpTypeImage %28 1D 0 0 0 2 R64i
3394 %30 = OpTypePointer UniformConstant %29
3395 %31 = OpVariable %30 UniformConstant
3396 %33 = OpConstant %6 64
3397 %47 = OpTypePointer Image %28
3398 %50 = OpConstantComposite %10 %19 %19 %19
3399 %4 = OpFunction %2 None %3
3401 %8 = OpVariable %7 Function
3402 %18 = OpVariable %7 Function
3403 %23 = OpVariable %7 Function
3404 %15 = OpAccessChain %14 %12 %13
3406 %17 = OpBitcast %6 %16
3408 %20 = OpAccessChain %14 %12 %19
3410 %22 = OpBitcast %6 %21
3412 %25 = OpAccessChain %14 %12 %24
3414 %27 = OpBitcast %6 %26
3417 %34 = OpSMod %6 %32 %33
3420 %37 = OpIMul %6 %35 %36
3423 %40 = OpIMul %6 %38 %39
3424 %41 = OpIAdd %6 %37 %40
3427 %44 = OpIMul %6 %42 %43
3428 %45 = OpIAdd %6 %41 %44
3429 %46 = OpSConvert %28 %45
3430 %48 = OpImageTexelPointer %47 %31 %34 %13
3431 %49 = ${OPNAME} %28 %48 %19 %13 ${LASTARG:default=%46}
3436 const std::string kShader_1d_r64i_intermediate_values = R"(
3437 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3438 ; replaced with a template parameter and the last argument for it has been made optional.
3441 ;precision highp iimage1D;
3442 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3443 ;#extension GL_EXT_shader_image_int64 : require
3445 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3446 ;layout (r64i, binding=0) coherent uniform iimage1D u_resultImage;
3447 ;layout (r64i, binding=1) writeonly uniform iimage1D u_intermValuesImage;
3451 ; int gx = int(gl_GlobalInvocationID.x);
3452 ; int gy = int(gl_GlobalInvocationID.y);
3453 ; int gz = int(gl_GlobalInvocationID.z);
3454 ; imageStore(u_intermValuesImage, gx, i64vec4(imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz))));
3459 ; Generator: Khronos Glslang Reference Front End; 8
3464 OpCapability Int64Atomics
3465 OpCapability Image1D
3466 OpCapability Int64ImageEXT
3467 OpExtension "SPV_EXT_shader_image_int64"
3468 %1 = OpExtInstImport "GLSL.std.450"
3469 OpMemoryModel Logical GLSL450
3470 OpEntryPoint GLCompute %4 "main" %12
3471 OpExecutionMode %4 LocalSize 1 1 1
3472 OpDecorate %12 BuiltIn GlobalInvocationId
3473 OpDecorate %31 DescriptorSet 0
3474 OpDecorate %31 Binding 1
3475 OpDecorate %31 NonReadable
3476 OpDecorate %34 DescriptorSet 0
3477 OpDecorate %34 Binding 0
3478 OpDecorate %34 Coherent
3479 OpDecorate %55 BuiltIn WorkgroupSize
3481 %3 = OpTypeFunction %2
3483 %7 = OpTypePointer Function %6
3485 %10 = OpTypeVector %9 3
3486 %11 = OpTypePointer Input %10
3487 %12 = OpVariable %11 Input
3488 %13 = OpConstant %9 0
3489 %14 = OpTypePointer Input %9
3490 %19 = OpConstant %9 1
3491 %24 = OpConstant %9 2
3492 %28 = OpTypeInt 64 1
3493 %29 = OpTypeImage %28 1D 0 0 0 2 R64i
3494 %30 = OpTypePointer UniformConstant %29
3495 %31 = OpVariable %30 UniformConstant
3496 %34 = OpVariable %30 UniformConstant
3497 %36 = OpConstant %6 64
3498 %50 = OpTypePointer Image %28
3499 %53 = OpTypeVector %28 4
3500 %55 = OpConstantComposite %10 %19 %19 %19
3501 %4 = OpFunction %2 None %3
3503 %8 = OpVariable %7 Function
3504 %18 = OpVariable %7 Function
3505 %23 = OpVariable %7 Function
3506 %15 = OpAccessChain %14 %12 %13
3508 %17 = OpBitcast %6 %16
3510 %20 = OpAccessChain %14 %12 %19
3512 %22 = OpBitcast %6 %21
3514 %25 = OpAccessChain %14 %12 %24
3516 %27 = OpBitcast %6 %26
3518 %32 = OpLoad %29 %31
3521 %37 = OpSMod %6 %35 %36
3524 %40 = OpIMul %6 %38 %39
3527 %43 = OpIMul %6 %41 %42
3528 %44 = OpIAdd %6 %40 %43
3531 %47 = OpIMul %6 %45 %46
3532 %48 = OpIAdd %6 %44 %47
3533 %49 = OpSConvert %28 %48
3534 %51 = OpImageTexelPointer %50 %34 %37 %13
3535 %52 = ${OPNAME} %28 %51 %19 %13 ${LASTARG:default=%49}
3536 %54 = OpCompositeConstruct %53 %52 %52 %52 %52
3537 OpImageWrite %32 %33 %54
3542 const std::string kShader_1d_array_r64ui_end_result = R"(
3543 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3544 ; replaced with a template parameter and the last argument for it has been made optional.
3547 ;precision highp uimage1DArray;
3548 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3549 ;#extension GL_EXT_shader_image_int64 : require
3551 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3552 ;layout (r64ui, binding=0) coherent uniform uimage1DArray u_resultImage;
3556 ; int gx = int(gl_GlobalInvocationID.x);
3557 ; int gy = int(gl_GlobalInvocationID.y);
3558 ; int gz = int(gl_GlobalInvocationID.z);
3559 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz));
3564 ; Generator: Khronos Glslang Reference Front End; 8
3569 OpCapability Int64Atomics
3570 OpCapability Image1D
3571 OpCapability Int64ImageEXT
3572 OpExtension "SPV_EXT_shader_image_int64"
3573 %1 = OpExtInstImport "GLSL.std.450"
3574 OpMemoryModel Logical GLSL450
3575 OpEntryPoint GLCompute %4 "main" %12
3576 OpExecutionMode %4 LocalSize 1 1 1
3577 OpDecorate %12 BuiltIn GlobalInvocationId
3578 OpDecorate %31 DescriptorSet 0
3579 OpDecorate %31 Binding 0
3580 OpDecorate %31 Coherent
3581 OpDecorate %55 BuiltIn WorkgroupSize
3583 %3 = OpTypeFunction %2
3585 %7 = OpTypePointer Function %6
3587 %10 = OpTypeVector %9 3
3588 %11 = OpTypePointer Input %10
3589 %12 = OpVariable %11 Input
3590 %13 = OpConstant %9 0
3591 %14 = OpTypePointer Input %9
3592 %19 = OpConstant %9 1
3593 %24 = OpConstant %9 2
3594 %28 = OpTypeInt 64 0
3595 %29 = OpTypeImage %28 1D 0 1 0 2 R64ui
3596 %30 = OpTypePointer UniformConstant %29
3597 %31 = OpVariable %30 UniformConstant
3598 %33 = OpConstant %6 64
3599 %36 = OpTypeVector %6 2
3600 %49 = OpTypeInt 64 1
3601 %52 = OpTypePointer Image %28
3602 %55 = OpConstantComposite %10 %19 %19 %19
3603 %4 = OpFunction %2 None %3
3605 %8 = OpVariable %7 Function
3606 %18 = OpVariable %7 Function
3607 %23 = OpVariable %7 Function
3608 %15 = OpAccessChain %14 %12 %13
3610 %17 = OpBitcast %6 %16
3612 %20 = OpAccessChain %14 %12 %19
3614 %22 = OpBitcast %6 %21
3616 %25 = OpAccessChain %14 %12 %24
3618 %27 = OpBitcast %6 %26
3621 %34 = OpSMod %6 %32 %33
3623 %37 = OpCompositeConstruct %36 %34 %35
3626 %40 = OpIMul %6 %38 %39
3629 %43 = OpIMul %6 %41 %42
3630 %44 = OpIAdd %6 %40 %43
3633 %47 = OpIMul %6 %45 %46
3634 %48 = OpIAdd %6 %44 %47
3635 %50 = OpSConvert %49 %48
3636 %51 = OpBitcast %28 %50
3637 %53 = OpImageTexelPointer %52 %31 %37 %13
3638 %54 = ${OPNAME} %28 %53 %19 %13 ${LASTARG:default=%51}
3643 const std::string kShader_1d_array_r64ui_intermediate_values = R"(
3644 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3645 ; replaced with a template parameter and the last argument for it has been made optional.
3648 ;precision highp uimage1DArray;
3649 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3650 ;#extension GL_EXT_shader_image_int64 : require
3652 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3653 ;layout (r64ui, binding=0) coherent uniform uimage1DArray u_resultImage;
3654 ;layout (r64ui, binding=1) writeonly uniform uimage1DArray u_intermValuesImage;
3658 ;int gx = int(gl_GlobalInvocationID.x);
3659 ;int gy = int(gl_GlobalInvocationID.y);
3660 ;int gz = int(gl_GlobalInvocationID.z);
3661 ;imageStore(u_intermValuesImage, ivec2(gx,gy), u64vec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz))));
3666 ; Generator: Khronos Glslang Reference Front End; 8
3671 OpCapability Int64Atomics
3672 OpCapability Image1D
3673 OpCapability Int64ImageEXT
3674 OpExtension "SPV_EXT_shader_image_int64"
3675 %1 = OpExtInstImport "GLSL.std.450"
3676 OpMemoryModel Logical GLSL450
3677 OpEntryPoint GLCompute %4 "main" %12
3678 OpExecutionMode %4 LocalSize 1 1 1
3679 OpDecorate %12 BuiltIn GlobalInvocationId
3680 OpDecorate %31 DescriptorSet 0
3681 OpDecorate %31 Binding 1
3682 OpDecorate %31 NonReadable
3683 OpDecorate %37 DescriptorSet 0
3684 OpDecorate %37 Binding 0
3685 OpDecorate %37 Coherent
3686 OpDecorate %62 BuiltIn WorkgroupSize
3688 %3 = OpTypeFunction %2
3690 %7 = OpTypePointer Function %6
3692 %10 = OpTypeVector %9 3
3693 %11 = OpTypePointer Input %10
3694 %12 = OpVariable %11 Input
3695 %13 = OpConstant %9 0
3696 %14 = OpTypePointer Input %9
3697 %19 = OpConstant %9 1
3698 %24 = OpConstant %9 2
3699 %28 = OpTypeInt 64 0
3700 %29 = OpTypeImage %28 1D 0 1 0 2 R64ui
3701 %30 = OpTypePointer UniformConstant %29
3702 %31 = OpVariable %30 UniformConstant
3703 %35 = OpTypeVector %6 2
3704 %37 = OpVariable %30 UniformConstant
3705 %39 = OpConstant %6 64
3706 %54 = OpTypeInt 64 1
3707 %57 = OpTypePointer Image %28
3708 %60 = OpTypeVector %28 4
3709 %62 = OpConstantComposite %10 %19 %19 %19
3710 %4 = OpFunction %2 None %3
3712 %8 = OpVariable %7 Function
3713 %18 = OpVariable %7 Function
3714 %23 = OpVariable %7 Function
3715 %15 = OpAccessChain %14 %12 %13
3717 %17 = OpBitcast %6 %16
3719 %20 = OpAccessChain %14 %12 %19
3721 %22 = OpBitcast %6 %21
3723 %25 = OpAccessChain %14 %12 %24
3725 %27 = OpBitcast %6 %26
3727 %32 = OpLoad %29 %31
3730 %36 = OpCompositeConstruct %35 %33 %34
3732 %40 = OpSMod %6 %38 %39
3734 %42 = OpCompositeConstruct %35 %40 %41
3737 %45 = OpIMul %6 %43 %44
3740 %48 = OpIMul %6 %46 %47
3741 %49 = OpIAdd %6 %45 %48
3744 %52 = OpIMul %6 %50 %51
3745 %53 = OpIAdd %6 %49 %52
3746 %55 = OpSConvert %54 %53
3747 %56 = OpBitcast %28 %55
3748 %58 = OpImageTexelPointer %57 %37 %42 %13
3749 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
3750 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
3751 OpImageWrite %32 %36 %61
3756 const std::string kShader_1d_array_r64i_end_result = R"(
3757 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3758 ; replaced with a template parameter and the last argument for it has been made optional.
3761 ; precision highp iimage1DArray;
3762 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3763 ; #extension GL_EXT_shader_image_int64 : require
3765 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3766 ; layout (r64i, binding=0) coherent uniform iimage1DArray u_resultImage;
3770 ; int gx = int(gl_GlobalInvocationID.x);
3771 ; int gy = int(gl_GlobalInvocationID.y);
3772 ; int gz = int(gl_GlobalInvocationID.z);
3773 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz));
3778 ; Generator: Khronos Glslang Reference Front End; 8
3783 OpCapability Int64Atomics
3784 OpCapability Image1D
3785 OpCapability Int64ImageEXT
3786 OpExtension "SPV_EXT_shader_image_int64"
3787 %1 = OpExtInstImport "GLSL.std.450"
3788 OpMemoryModel Logical GLSL450
3789 OpEntryPoint GLCompute %4 "main" %12
3790 OpExecutionMode %4 LocalSize 1 1 1
3791 OpDecorate %12 BuiltIn GlobalInvocationId
3792 OpDecorate %31 DescriptorSet 0
3793 OpDecorate %31 Binding 0
3794 OpDecorate %31 Coherent
3795 OpDecorate %53 BuiltIn WorkgroupSize
3797 %3 = OpTypeFunction %2
3799 %7 = OpTypePointer Function %6
3801 %10 = OpTypeVector %9 3
3802 %11 = OpTypePointer Input %10
3803 %12 = OpVariable %11 Input
3804 %13 = OpConstant %9 0
3805 %14 = OpTypePointer Input %9
3806 %19 = OpConstant %9 1
3807 %24 = OpConstant %9 2
3808 %28 = OpTypeInt 64 1
3809 %29 = OpTypeImage %28 1D 0 1 0 2 R64i
3810 %30 = OpTypePointer UniformConstant %29
3811 %31 = OpVariable %30 UniformConstant
3812 %33 = OpConstant %6 64
3813 %36 = OpTypeVector %6 2
3814 %50 = OpTypePointer Image %28
3815 %53 = OpConstantComposite %10 %19 %19 %19
3816 %4 = OpFunction %2 None %3
3818 %8 = OpVariable %7 Function
3819 %18 = OpVariable %7 Function
3820 %23 = OpVariable %7 Function
3821 %15 = OpAccessChain %14 %12 %13
3823 %17 = OpBitcast %6 %16
3825 %20 = OpAccessChain %14 %12 %19
3827 %22 = OpBitcast %6 %21
3829 %25 = OpAccessChain %14 %12 %24
3831 %27 = OpBitcast %6 %26
3834 %34 = OpSMod %6 %32 %33
3836 %37 = OpCompositeConstruct %36 %34 %35
3839 %40 = OpIMul %6 %38 %39
3842 %43 = OpIMul %6 %41 %42
3843 %44 = OpIAdd %6 %40 %43
3846 %47 = OpIMul %6 %45 %46
3847 %48 = OpIAdd %6 %44 %47
3848 %49 = OpSConvert %28 %48
3849 %51 = OpImageTexelPointer %50 %31 %37 %13
3850 %52 = ${OPNAME} %28 %51 %19 %13 ${LASTARG:default=%49}
3855 const std::string kShader_1d_array_r64i_intermediate_values = R"(
3856 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3857 ; replaced with a template parameter and the last argument for it has been made optional.
3860 ; precision highp iimage1DArray;
3861 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3862 ; #extension GL_EXT_shader_image_int64 : require
3864 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3865 ; layout (r64i, binding=0) coherent uniform iimage1DArray u_resultImage;
3866 ; layout (r64i, binding=1) writeonly uniform iimage1DArray u_intermValuesImage;
3870 ; int gx = int(gl_GlobalInvocationID.x);
3871 ; int gy = int(gl_GlobalInvocationID.y);
3872 ; int gz = int(gl_GlobalInvocationID.z);
3873 ; imageStore(u_intermValuesImage, ivec2(gx, gy), i64vec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64, gy), int(gx*gx + gy*gy + gz*gz))));
3878 ; Generator: Khronos Glslang Reference Front End; 8
3883 OpCapability Int64Atomics
3884 OpCapability Image1D
3885 OpCapability Int64ImageEXT
3886 OpExtension "SPV_EXT_shader_image_int64"
3887 %1 = OpExtInstImport "GLSL.std.450"
3888 OpMemoryModel Logical GLSL450
3889 OpEntryPoint GLCompute %4 "main" %12
3890 OpExecutionMode %4 LocalSize 1 1 1
3891 OpDecorate %12 BuiltIn GlobalInvocationId
3892 OpDecorate %31 DescriptorSet 0
3893 OpDecorate %31 Binding 1
3894 OpDecorate %31 NonReadable
3895 OpDecorate %37 DescriptorSet 0
3896 OpDecorate %37 Binding 0
3897 OpDecorate %37 Coherent
3898 OpDecorate %60 BuiltIn WorkgroupSize
3900 %3 = OpTypeFunction %2
3902 %7 = OpTypePointer Function %6
3904 %10 = OpTypeVector %9 3
3905 %11 = OpTypePointer Input %10
3906 %12 = OpVariable %11 Input
3907 %13 = OpConstant %9 0
3908 %14 = OpTypePointer Input %9
3909 %19 = OpConstant %9 1
3910 %24 = OpConstant %9 2
3911 %28 = OpTypeInt 64 1
3912 %29 = OpTypeImage %28 1D 0 1 0 2 R64i
3913 %30 = OpTypePointer UniformConstant %29
3914 %31 = OpVariable %30 UniformConstant
3915 %35 = OpTypeVector %6 2
3916 %37 = OpVariable %30 UniformConstant
3917 %39 = OpConstant %6 64
3918 %55 = OpTypePointer Image %28
3919 %58 = OpTypeVector %28 4
3920 %60 = OpConstantComposite %10 %19 %19 %19
3921 %4 = OpFunction %2 None %3
3923 %8 = OpVariable %7 Function
3924 %18 = OpVariable %7 Function
3925 %23 = OpVariable %7 Function
3926 %15 = OpAccessChain %14 %12 %13
3928 %17 = OpBitcast %6 %16
3930 %20 = OpAccessChain %14 %12 %19
3932 %22 = OpBitcast %6 %21
3934 %25 = OpAccessChain %14 %12 %24
3936 %27 = OpBitcast %6 %26
3938 %32 = OpLoad %29 %31
3941 %36 = OpCompositeConstruct %35 %33 %34
3943 %40 = OpSMod %6 %38 %39
3945 %42 = OpCompositeConstruct %35 %40 %41
3948 %45 = OpIMul %6 %43 %44
3951 %48 = OpIMul %6 %46 %47
3952 %49 = OpIAdd %6 %45 %48
3955 %52 = OpIMul %6 %50 %51
3956 %53 = OpIAdd %6 %49 %52
3957 %54 = OpSConvert %28 %53
3958 %56 = OpImageTexelPointer %55 %37 %42 %13
3959 %57 = ${OPNAME} %28 %56 %19 %13 ${LASTARG:default=%54}
3960 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
3961 OpImageWrite %32 %36 %59
3966 const std::string kShader_2d_r64ui_end_result = R"(
3967 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
3968 ; replaced with a template parameter and the last argument for it has been made optional.
3971 ; precision highp uimage2D;
3972 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
3973 ; #extension GL_EXT_shader_image_int64 : require
3975 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
3976 ; layout (r64ui, binding=0) coherent uniform uimage2D u_resultImage;
3980 ; int gx = int(gl_GlobalInvocationID.x);
3981 ; int gy = int(gl_GlobalInvocationID.y);
3982 ; int gz = int(gl_GlobalInvocationID.z);
3983 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz));
3988 ; Generator: Khronos Glslang Reference Front End; 8
3993 OpCapability Int64Atomics
3994 OpCapability Int64ImageEXT
3995 OpExtension "SPV_EXT_shader_image_int64"
3996 %1 = OpExtInstImport "GLSL.std.450"
3997 OpMemoryModel Logical GLSL450
3998 OpEntryPoint GLCompute %4 "main" %12
3999 OpExecutionMode %4 LocalSize 1 1 1
4000 OpDecorate %12 BuiltIn GlobalInvocationId
4001 OpDecorate %31 DescriptorSet 0
4002 OpDecorate %31 Binding 0
4003 OpDecorate %31 Coherent
4004 OpDecorate %55 BuiltIn WorkgroupSize
4006 %3 = OpTypeFunction %2
4008 %7 = OpTypePointer Function %6
4010 %10 = OpTypeVector %9 3
4011 %11 = OpTypePointer Input %10
4012 %12 = OpVariable %11 Input
4013 %13 = OpConstant %9 0
4014 %14 = OpTypePointer Input %9
4015 %19 = OpConstant %9 1
4016 %24 = OpConstant %9 2
4017 %28 = OpTypeInt 64 0
4018 %29 = OpTypeImage %28 2D 0 0 0 2 R64ui
4019 %30 = OpTypePointer UniformConstant %29
4020 %31 = OpVariable %30 UniformConstant
4021 %33 = OpConstant %6 64
4022 %36 = OpTypeVector %6 2
4023 %49 = OpTypeInt 64 1
4024 %52 = OpTypePointer Image %28
4025 %55 = OpConstantComposite %10 %19 %19 %19
4026 %4 = OpFunction %2 None %3
4028 %8 = OpVariable %7 Function
4029 %18 = OpVariable %7 Function
4030 %23 = OpVariable %7 Function
4031 %15 = OpAccessChain %14 %12 %13
4033 %17 = OpBitcast %6 %16
4035 %20 = OpAccessChain %14 %12 %19
4037 %22 = OpBitcast %6 %21
4039 %25 = OpAccessChain %14 %12 %24
4041 %27 = OpBitcast %6 %26
4044 %34 = OpSMod %6 %32 %33
4046 %37 = OpCompositeConstruct %36 %34 %35
4049 %40 = OpIMul %6 %38 %39
4052 %43 = OpIMul %6 %41 %42
4053 %44 = OpIAdd %6 %40 %43
4056 %47 = OpIMul %6 %45 %46
4057 %48 = OpIAdd %6 %44 %47
4058 %50 = OpSConvert %49 %48
4059 %51 = OpBitcast %28 %50
4060 %53 = OpImageTexelPointer %52 %31 %37 %13
4061 %54 = ${OPNAME} %28 %53 %19 %13 ${LASTARG:default=%51}
4066 const std::string kShader_2d_r64ui_intermediate_values = R"(
4067 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4068 ; replaced with a template parameter and the last argument for it has been made optional.
4071 ; precision highp uimage2D;
4072 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4073 ; #extension GL_EXT_shader_image_int64 : require
4074 ; layout (r64ui, binding=0) coherent uniform uimage2D u_resultImage;
4075 ; layout (r64ui, binding=1) writeonly uniform uimage2D u_intermValuesImage;
4077 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4081 ; int gx = int(gl_GlobalInvocationID.x);
4082 ; int gy = int(gl_GlobalInvocationID.y);
4083 ; int gz = int(gl_GlobalInvocationID.z);
4084 ; imageStore(u_intermValuesImage, ivec2(gx,gy), u64vec4(imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), uint(gx*gx + gy*gy + gz*gz))));
4089 ; Generator: Khronos Glslang Reference Front End; 8
4094 OpCapability Int64Atomics
4095 OpCapability Int64ImageEXT
4096 OpExtension "SPV_EXT_shader_image_int64"
4097 %1 = OpExtInstImport "GLSL.std.450"
4098 OpMemoryModel Logical GLSL450
4099 OpEntryPoint GLCompute %4 "main" %12
4100 OpExecutionMode %4 LocalSize 1 1 1
4101 OpDecorate %12 BuiltIn GlobalInvocationId
4102 OpDecorate %31 DescriptorSet 0
4103 OpDecorate %31 Binding 1
4104 OpDecorate %31 NonReadable
4105 OpDecorate %37 DescriptorSet 0
4106 OpDecorate %37 Binding 0
4107 OpDecorate %37 Coherent
4108 OpDecorate %62 BuiltIn WorkgroupSize
4110 %3 = OpTypeFunction %2
4112 %7 = OpTypePointer Function %6
4114 %10 = OpTypeVector %9 3
4115 %11 = OpTypePointer Input %10
4116 %12 = OpVariable %11 Input
4117 %13 = OpConstant %9 0
4118 %14 = OpTypePointer Input %9
4119 %19 = OpConstant %9 1
4120 %24 = OpConstant %9 2
4121 %28 = OpTypeInt 64 0
4122 %29 = OpTypeImage %28 2D 0 0 0 2 R64ui
4123 %30 = OpTypePointer UniformConstant %29
4124 %31 = OpVariable %30 UniformConstant
4125 %35 = OpTypeVector %6 2
4126 %37 = OpVariable %30 UniformConstant
4127 %39 = OpConstant %6 64
4128 %54 = OpTypeInt 64 1
4129 %57 = OpTypePointer Image %28
4130 %60 = OpTypeVector %28 4
4131 %62 = OpConstantComposite %10 %19 %19 %19
4132 %4 = OpFunction %2 None %3
4134 %8 = OpVariable %7 Function
4135 %18 = OpVariable %7 Function
4136 %23 = OpVariable %7 Function
4137 %15 = OpAccessChain %14 %12 %13
4139 %17 = OpBitcast %6 %16
4141 %20 = OpAccessChain %14 %12 %19
4143 %22 = OpBitcast %6 %21
4145 %25 = OpAccessChain %14 %12 %24
4147 %27 = OpBitcast %6 %26
4149 %32 = OpLoad %29 %31
4152 %36 = OpCompositeConstruct %35 %33 %34
4154 %40 = OpSMod %6 %38 %39
4156 %42 = OpCompositeConstruct %35 %40 %41
4159 %45 = OpIMul %6 %43 %44
4162 %48 = OpIMul %6 %46 %47
4163 %49 = OpIAdd %6 %45 %48
4166 %52 = OpIMul %6 %50 %51
4167 %53 = OpIAdd %6 %49 %52
4168 %55 = OpSConvert %54 %53
4169 %56 = OpBitcast %28 %55
4170 %58 = OpImageTexelPointer %57 %37 %42 %13
4171 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
4172 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
4173 OpImageWrite %32 %36 %61
4178 const std::string kShader_2d_r64i_end_result = R"(
4179 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4180 ; replaced with a template parameter and the last argument for it has been made optional.
4183 ; precision highp iimage2D;
4184 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4185 ; #extension GL_EXT_shader_image_int64 : require
4187 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4188 ; layout (r64i, binding=0) coherent uniform iimage2D u_resultImage;
4192 ; int gx = int(gl_GlobalInvocationID.x);
4193 ; int gy = int(gl_GlobalInvocationID.y);
4194 ; int gz = int(gl_GlobalInvocationID.z);
4195 ; imageAtomicAdd(u_resultImage, ivec2(gx % 64,gy), int(gx*gx + gy*gy + gz*gz));
4200 ; Generator: Khronos Glslang Reference Front End; 8
4205 OpCapability Int64Atomics
4206 OpCapability Int64ImageEXT
4207 OpExtension "SPV_EXT_shader_image_int64"
4208 %1 = OpExtInstImport "GLSL.std.450"
4209 OpMemoryModel Logical GLSL450
4210 OpEntryPoint GLCompute %4 "main" %12
4211 OpExecutionMode %4 LocalSize 1 1 1
4212 OpDecorate %12 BuiltIn GlobalInvocationId
4213 OpDecorate %31 DescriptorSet 0
4214 OpDecorate %31 Binding 0
4215 OpDecorate %31 Coherent
4216 OpDecorate %53 BuiltIn WorkgroupSize
4218 %3 = OpTypeFunction %2
4220 %7 = OpTypePointer Function %6
4222 %10 = OpTypeVector %9 3
4223 %11 = OpTypePointer Input %10
4224 %12 = OpVariable %11 Input
4225 %13 = OpConstant %9 0
4226 %14 = OpTypePointer Input %9
4227 %19 = OpConstant %9 1
4228 %24 = OpConstant %9 2
4229 %28 = OpTypeInt 64 1
4230 %29 = OpTypeImage %28 2D 0 0 0 2 R64i
4231 %30 = OpTypePointer UniformConstant %29
4232 %31 = OpVariable %30 UniformConstant
4233 %33 = OpConstant %6 64
4234 %36 = OpTypeVector %6 2
4235 %50 = OpTypePointer Image %28
4236 %53 = OpConstantComposite %10 %19 %19 %19
4237 %4 = OpFunction %2 None %3
4239 %8 = OpVariable %7 Function
4240 %18 = OpVariable %7 Function
4241 %23 = OpVariable %7 Function
4242 %15 = OpAccessChain %14 %12 %13
4244 %17 = OpBitcast %6 %16
4246 %20 = OpAccessChain %14 %12 %19
4248 %22 = OpBitcast %6 %21
4250 %25 = OpAccessChain %14 %12 %24
4252 %27 = OpBitcast %6 %26
4255 %34 = OpSMod %6 %32 %33
4257 %37 = OpCompositeConstruct %36 %34 %35
4260 %40 = OpIMul %6 %38 %39
4263 %43 = OpIMul %6 %41 %42
4264 %44 = OpIAdd %6 %40 %43
4267 %47 = OpIMul %6 %45 %46
4268 %48 = OpIAdd %6 %44 %47
4269 %49 = OpSConvert %28 %48
4270 %51 = OpImageTexelPointer %50 %31 %37 %13
4271 %52 = ${OPNAME} %28 %51 %19 %13 ${LASTARG:default=%49}
4276 const std::string kShader_2d_r64i_intermediate_values = R"(
4277 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4278 ; replaced with a template parameter and the last argument for it has been made optional.
4281 ; precision highp iimage2D;
4282 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4283 ; #extension GL_EXT_shader_image_int64 : require
4285 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4286 ; layout (r64i, binding=0) coherent uniform iimage2D u_resultImage;
4287 ; layout (r64i, binding=1) writeonly uniform iimage2D u_intermValuesImage;
4291 ; int gx = int(gl_GlobalInvocationID.x);
4292 ; int gy = int(gl_GlobalInvocationID.y);
4293 ; int gz = int(gl_GlobalInvocationID.z);
4294 ; imageStore(u_intermValuesImage, ivec2(gx, gy), i64vec4(imageAtomicAdd(u_resultImage, ivec2(gx%64, gy), int(gx*gx + gy*gy + gz*gz))));
4299 ; Generator: Khronos Glslang Reference Front End; 8
4304 OpCapability Int64Atomics
4305 OpCapability Int64ImageEXT
4306 OpExtension "SPV_EXT_shader_image_int64"
4307 %1 = OpExtInstImport "GLSL.std.450"
4308 OpMemoryModel Logical GLSL450
4309 OpEntryPoint GLCompute %4 "main" %12
4310 OpExecutionMode %4 LocalSize 1 1 1
4311 OpDecorate %12 BuiltIn GlobalInvocationId
4312 OpDecorate %31 DescriptorSet 0
4313 OpDecorate %31 Binding 1
4314 OpDecorate %31 NonReadable
4315 OpDecorate %37 DescriptorSet 0
4316 OpDecorate %37 Binding 0
4317 OpDecorate %37 Coherent
4318 OpDecorate %60 BuiltIn WorkgroupSize
4320 %3 = OpTypeFunction %2
4322 %7 = OpTypePointer Function %6
4324 %10 = OpTypeVector %9 3
4325 %11 = OpTypePointer Input %10
4326 %12 = OpVariable %11 Input
4327 %13 = OpConstant %9 0
4328 %14 = OpTypePointer Input %9
4329 %19 = OpConstant %9 1
4330 %24 = OpConstant %9 2
4331 %28 = OpTypeInt 64 1
4332 %29 = OpTypeImage %28 2D 0 0 0 2 R64i
4333 %30 = OpTypePointer UniformConstant %29
4334 %31 = OpVariable %30 UniformConstant
4335 %35 = OpTypeVector %6 2
4336 %37 = OpVariable %30 UniformConstant
4337 %39 = OpConstant %6 64
4338 %55 = OpTypePointer Image %28
4339 %58 = OpTypeVector %28 4
4340 %60 = OpConstantComposite %10 %19 %19 %19
4341 %4 = OpFunction %2 None %3
4343 %8 = OpVariable %7 Function
4344 %18 = OpVariable %7 Function
4345 %23 = OpVariable %7 Function
4346 %15 = OpAccessChain %14 %12 %13
4348 %17 = OpBitcast %6 %16
4350 %20 = OpAccessChain %14 %12 %19
4352 %22 = OpBitcast %6 %21
4354 %25 = OpAccessChain %14 %12 %24
4356 %27 = OpBitcast %6 %26
4358 %32 = OpLoad %29 %31
4361 %36 = OpCompositeConstruct %35 %33 %34
4363 %40 = OpSMod %6 %38 %39
4365 %42 = OpCompositeConstruct %35 %40 %41
4368 %45 = OpIMul %6 %43 %44
4371 %48 = OpIMul %6 %46 %47
4372 %49 = OpIAdd %6 %45 %48
4375 %52 = OpIMul %6 %50 %51
4376 %53 = OpIAdd %6 %49 %52
4377 %54 = OpSConvert %28 %53
4378 %56 = OpImageTexelPointer %55 %37 %42 %13
4379 %57 = ${OPNAME} %28 %56 %19 %13 ${LASTARG:default=%54}
4380 %59 = OpCompositeConstruct %58 %57 %57 %57 %57
4381 OpImageWrite %32 %36 %59
4386 const std::string kShader_2d_array_r64ui_end_result = R"(
4387 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4388 ; replaced with a template parameter and the last argument for it has been made optional.
4391 ; precision highp uimage2DArray;
4392 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4393 ; #extension GL_EXT_shader_image_int64 : require
4395 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4396 ; layout (r64ui, binding=0) coherent uniform uimage2DArray u_resultImage;
4400 ; int gx = int(gl_GlobalInvocationID.x);
4401 ; int gy = int(gl_GlobalInvocationID.y);
4402 ; int gz = int(gl_GlobalInvocationID.z);
4403 ; imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz));
4408 ; Generator: Khronos Glslang Reference Front End; 8
4413 OpCapability Int64Atomics
4414 OpCapability Int64ImageEXT
4415 OpExtension "SPV_EXT_shader_image_int64"
4416 %1 = OpExtInstImport "GLSL.std.450"
4417 OpMemoryModel Logical GLSL450
4418 OpEntryPoint GLCompute %4 "main" %12
4419 OpExecutionMode %4 LocalSize 1 1 1
4420 OpDecorate %12 BuiltIn GlobalInvocationId
4421 OpDecorate %31 DescriptorSet 0
4422 OpDecorate %31 Binding 0
4423 OpDecorate %31 Coherent
4424 OpDecorate %56 BuiltIn WorkgroupSize
4426 %3 = OpTypeFunction %2
4428 %7 = OpTypePointer Function %6
4430 %10 = OpTypeVector %9 3
4431 %11 = OpTypePointer Input %10
4432 %12 = OpVariable %11 Input
4433 %13 = OpConstant %9 0
4434 %14 = OpTypePointer Input %9
4435 %19 = OpConstant %9 1
4436 %24 = OpConstant %9 2
4437 %28 = OpTypeInt 64 0
4438 %29 = OpTypeImage %28 2D 0 1 0 2 R64ui
4439 %30 = OpTypePointer UniformConstant %29
4440 %31 = OpVariable %30 UniformConstant
4441 %33 = OpConstant %6 64
4442 %37 = OpTypeVector %6 3
4443 %50 = OpTypeInt 64 1
4444 %53 = OpTypePointer Image %28
4445 %56 = OpConstantComposite %10 %19 %19 %19
4446 %4 = OpFunction %2 None %3
4448 %8 = OpVariable %7 Function
4449 %18 = OpVariable %7 Function
4450 %23 = OpVariable %7 Function
4451 %15 = OpAccessChain %14 %12 %13
4453 %17 = OpBitcast %6 %16
4455 %20 = OpAccessChain %14 %12 %19
4457 %22 = OpBitcast %6 %21
4459 %25 = OpAccessChain %14 %12 %24
4461 %27 = OpBitcast %6 %26
4464 %34 = OpSMod %6 %32 %33
4467 %38 = OpCompositeConstruct %37 %34 %35 %36
4470 %41 = OpIMul %6 %39 %40
4473 %44 = OpIMul %6 %42 %43
4474 %45 = OpIAdd %6 %41 %44
4477 %48 = OpIMul %6 %46 %47
4478 %49 = OpIAdd %6 %45 %48
4479 %51 = OpSConvert %50 %49
4480 %52 = OpBitcast %28 %51
4481 %54 = OpImageTexelPointer %53 %31 %38 %13
4482 %55 = ${OPNAME} %28 %54 %19 %13 ${LASTARG:default=%52}
4487 const std::string kShader_2d_array_r64ui_intermediate_values = R"(
4488 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4489 ; replaced with a template parameter and the last argument for it has been made optional.
4492 ; precision highp uimage2DArray;
4493 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4494 ; #extension GL_EXT_shader_image_int64 : require
4496 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4497 ; layout (r64ui, binding=0) coherent uniform uimage2DArray u_resultImage;
4498 ; layout (r64ui, binding=1) writeonly uniform uimage2DArray u_intermValuesImage;
4502 ; int gx = int(gl_GlobalInvocationID.x);
4503 ; int gy = int(gl_GlobalInvocationID.y);
4504 ; int gz = int(gl_GlobalInvocationID.z);
4505 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), u64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz))));
4510 ; Generator: Khronos Glslang Reference Front End; 8
4515 OpCapability Int64Atomics
4516 OpCapability Int64ImageEXT
4517 OpExtension "SPV_EXT_shader_image_int64"
4518 %1 = OpExtInstImport "GLSL.std.450"
4519 OpMemoryModel Logical GLSL450
4520 OpEntryPoint GLCompute %4 "main" %12
4521 OpExecutionMode %4 LocalSize 1 1 1
4522 OpDecorate %12 BuiltIn GlobalInvocationId
4523 OpDecorate %31 DescriptorSet 0
4524 OpDecorate %31 Binding 1
4525 OpDecorate %31 NonReadable
4526 OpDecorate %38 DescriptorSet 0
4527 OpDecorate %38 Binding 0
4528 OpDecorate %38 Coherent
4529 OpDecorate %64 BuiltIn WorkgroupSize
4531 %3 = OpTypeFunction %2
4533 %7 = OpTypePointer Function %6
4535 %10 = OpTypeVector %9 3
4536 %11 = OpTypePointer Input %10
4537 %12 = OpVariable %11 Input
4538 %13 = OpConstant %9 0
4539 %14 = OpTypePointer Input %9
4540 %19 = OpConstant %9 1
4541 %24 = OpConstant %9 2
4542 %28 = OpTypeInt 64 0
4543 %29 = OpTypeImage %28 2D 0 1 0 2 R64ui
4544 %30 = OpTypePointer UniformConstant %29
4545 %31 = OpVariable %30 UniformConstant
4546 %36 = OpTypeVector %6 3
4547 %38 = OpVariable %30 UniformConstant
4548 %40 = OpConstant %6 64
4549 %56 = OpTypeInt 64 1
4550 %59 = OpTypePointer Image %28
4551 %62 = OpTypeVector %28 4
4552 %64 = OpConstantComposite %10 %19 %19 %19
4553 %4 = OpFunction %2 None %3
4555 %8 = OpVariable %7 Function
4556 %18 = OpVariable %7 Function
4557 %23 = OpVariable %7 Function
4558 %15 = OpAccessChain %14 %12 %13
4560 %17 = OpBitcast %6 %16
4562 %20 = OpAccessChain %14 %12 %19
4564 %22 = OpBitcast %6 %21
4566 %25 = OpAccessChain %14 %12 %24
4568 %27 = OpBitcast %6 %26
4570 %32 = OpLoad %29 %31
4574 %37 = OpCompositeConstruct %36 %33 %34 %35
4576 %41 = OpSMod %6 %39 %40
4579 %44 = OpCompositeConstruct %36 %41 %42 %43
4582 %47 = OpIMul %6 %45 %46
4585 %50 = OpIMul %6 %48 %49
4586 %51 = OpIAdd %6 %47 %50
4589 %54 = OpIMul %6 %52 %53
4590 %55 = OpIAdd %6 %51 %54
4591 %57 = OpSConvert %56 %55
4592 %58 = OpBitcast %28 %57
4593 %60 = OpImageTexelPointer %59 %38 %44 %13
4594 %61 = ${OPNAME} %28 %60 %19 %13 ${LASTARG:default=%58}
4595 %63 = OpCompositeConstruct %62 %61 %61 %61 %61
4596 OpImageWrite %32 %37 %63
4601 const std::string kShader_2d_array_r64i_end_result = R"(
4602 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4603 ; replaced with a template parameter and the last argument for it has been made optional.
4606 ; precision highp iimage2DArray;
4607 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4608 ; #extension GL_EXT_shader_image_int64 : require
4610 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4611 ; layout (r64i, binding=0) coherent uniform iimage2DArray u_resultImage;
4615 ; int gx = int(gl_GlobalInvocationID.x);
4616 ; int gy = int(gl_GlobalInvocationID.y);
4617 ; int gz = int(gl_GlobalInvocationID.z);
4618 ; imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), int(gx*gx + gy*gy + gz*gz));
4623 ; Generator: Khronos Glslang Reference Front End; 8
4628 OpCapability Int64Atomics
4629 OpCapability Int64ImageEXT
4630 OpExtension "SPV_EXT_shader_image_int64"
4631 %1 = OpExtInstImport "GLSL.std.450"
4632 OpMemoryModel Logical GLSL450
4633 OpEntryPoint GLCompute %4 "main" %12
4634 OpExecutionMode %4 LocalSize 1 1 1
4635 OpDecorate %12 BuiltIn GlobalInvocationId
4636 OpDecorate %31 DescriptorSet 0
4637 OpDecorate %31 Binding 0
4638 OpDecorate %31 Coherent
4639 OpDecorate %54 BuiltIn WorkgroupSize
4641 %3 = OpTypeFunction %2
4643 %7 = OpTypePointer Function %6
4645 %10 = OpTypeVector %9 3
4646 %11 = OpTypePointer Input %10
4647 %12 = OpVariable %11 Input
4648 %13 = OpConstant %9 0
4649 %14 = OpTypePointer Input %9
4650 %19 = OpConstant %9 1
4651 %24 = OpConstant %9 2
4652 %28 = OpTypeInt 64 1
4653 %29 = OpTypeImage %28 2D 0 1 0 2 R64i
4654 %30 = OpTypePointer UniformConstant %29
4655 %31 = OpVariable %30 UniformConstant
4656 %33 = OpConstant %6 64
4657 %37 = OpTypeVector %6 3
4658 %51 = OpTypePointer Image %28
4659 %54 = OpConstantComposite %10 %19 %19 %19
4660 %4 = OpFunction %2 None %3
4662 %8 = OpVariable %7 Function
4663 %18 = OpVariable %7 Function
4664 %23 = OpVariable %7 Function
4665 %15 = OpAccessChain %14 %12 %13
4667 %17 = OpBitcast %6 %16
4669 %20 = OpAccessChain %14 %12 %19
4671 %22 = OpBitcast %6 %21
4673 %25 = OpAccessChain %14 %12 %24
4675 %27 = OpBitcast %6 %26
4678 %34 = OpSMod %6 %32 %33
4681 %38 = OpCompositeConstruct %37 %34 %35 %36
4684 %41 = OpIMul %6 %39 %40
4687 %44 = OpIMul %6 %42 %43
4688 %45 = OpIAdd %6 %41 %44
4691 %48 = OpIMul %6 %46 %47
4692 %49 = OpIAdd %6 %45 %48
4693 %50 = OpSConvert %28 %49
4694 %52 = OpImageTexelPointer %51 %31 %38 %13
4695 %53 = ${OPNAME} %28 %52 %19 %13 ${LASTARG:default=%50}
4700 const std::string kShader_2d_array_r64i_intermediate_values = R"(
4701 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4702 ; replaced with a template parameter and the last argument for it has been made optional.
4705 ; precision highp iimage2DArray;
4706 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4707 ; #extension GL_EXT_shader_image_int64 : require
4709 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4710 ; layout (r64i, binding=0) coherent uniform iimage2DArray u_resultImage;
4711 ; layout (r64i, binding=1) writeonly uniform iimage2DArray u_intermValuesImage;
4715 ; int gx = int(gl_GlobalInvocationID.x);
4716 ; int gy = int(gl_GlobalInvocationID.y);
4717 ; int gz = int(gl_GlobalInvocationID.z);
4718 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), i64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), int(gx*gx + gy*gy + gz*gz))));
4723 ; Generator: Khronos Glslang Reference Front End; 8
4728 OpCapability Int64Atomics
4729 OpCapability Int64ImageEXT
4730 OpExtension "SPV_EXT_shader_image_int64"
4731 %1 = OpExtInstImport "GLSL.std.450"
4732 OpMemoryModel Logical GLSL450
4733 OpEntryPoint GLCompute %4 "main" %12
4734 OpExecutionMode %4 LocalSize 1 1 1
4735 OpDecorate %12 BuiltIn GlobalInvocationId
4736 OpDecorate %31 DescriptorSet 0
4737 OpDecorate %31 Binding 1
4738 OpDecorate %31 NonReadable
4739 OpDecorate %38 DescriptorSet 0
4740 OpDecorate %38 Binding 0
4741 OpDecorate %38 Coherent
4742 OpDecorate %62 BuiltIn WorkgroupSize
4744 %3 = OpTypeFunction %2
4746 %7 = OpTypePointer Function %6
4748 %10 = OpTypeVector %9 3
4749 %11 = OpTypePointer Input %10
4750 %12 = OpVariable %11 Input
4751 %13 = OpConstant %9 0
4752 %14 = OpTypePointer Input %9
4753 %19 = OpConstant %9 1
4754 %24 = OpConstant %9 2
4755 %28 = OpTypeInt 64 1
4756 %29 = OpTypeImage %28 2D 0 1 0 2 R64i
4757 %30 = OpTypePointer UniformConstant %29
4758 %31 = OpVariable %30 UniformConstant
4759 %36 = OpTypeVector %6 3
4760 %38 = OpVariable %30 UniformConstant
4761 %40 = OpConstant %6 64
4762 %57 = OpTypePointer Image %28
4763 %60 = OpTypeVector %28 4
4764 %62 = OpConstantComposite %10 %19 %19 %19
4765 %4 = OpFunction %2 None %3
4767 %8 = OpVariable %7 Function
4768 %18 = OpVariable %7 Function
4769 %23 = OpVariable %7 Function
4770 %15 = OpAccessChain %14 %12 %13
4772 %17 = OpBitcast %6 %16
4774 %20 = OpAccessChain %14 %12 %19
4776 %22 = OpBitcast %6 %21
4778 %25 = OpAccessChain %14 %12 %24
4780 %27 = OpBitcast %6 %26
4782 %32 = OpLoad %29 %31
4786 %37 = OpCompositeConstruct %36 %33 %34 %35
4788 %41 = OpSMod %6 %39 %40
4791 %44 = OpCompositeConstruct %36 %41 %42 %43
4794 %47 = OpIMul %6 %45 %46
4797 %50 = OpIMul %6 %48 %49
4798 %51 = OpIAdd %6 %47 %50
4801 %54 = OpIMul %6 %52 %53
4802 %55 = OpIAdd %6 %51 %54
4803 %56 = OpSConvert %28 %55
4804 %58 = OpImageTexelPointer %57 %38 %44 %13
4805 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
4806 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
4807 OpImageWrite %32 %37 %61
4812 const std::string kShader_3d_r64ui_end_result = R"(
4813 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4814 ; replaced with a template parameter and the last argument for it has been made optional.
4817 ; precision highp uimage3D;
4818 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4819 ; #extension GL_EXT_shader_image_int64 : require
4821 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4822 ; layout (r64ui, binding=0) coherent uniform uimage3D u_resultImage;
4826 ; int gx = int(gl_GlobalInvocationID.x);
4827 ; int gy = int(gl_GlobalInvocationID.y);
4828 ; int gz = int(gl_GlobalInvocationID.z);
4829 ; imageAtomicAdd(u_resultImage, ivec3(gx%48, gy, gz), uint(gx*gx + gy*gy + gz*gz));
4834 ; Generator: Khronos Glslang Reference Front End; 8
4839 OpCapability Int64Atomics
4840 OpCapability Int64ImageEXT
4841 OpExtension "SPV_EXT_shader_image_int64"
4842 %1 = OpExtInstImport "GLSL.std.450"
4843 OpMemoryModel Logical GLSL450
4844 OpEntryPoint GLCompute %4 "main" %12
4845 OpExecutionMode %4 LocalSize 1 1 1
4846 OpDecorate %12 BuiltIn GlobalInvocationId
4847 OpDecorate %31 DescriptorSet 0
4848 OpDecorate %31 Binding 0
4849 OpDecorate %31 Coherent
4850 OpDecorate %56 BuiltIn WorkgroupSize
4852 %3 = OpTypeFunction %2
4854 %7 = OpTypePointer Function %6
4856 %10 = OpTypeVector %9 3
4857 %11 = OpTypePointer Input %10
4858 %12 = OpVariable %11 Input
4859 %13 = OpConstant %9 0
4860 %14 = OpTypePointer Input %9
4861 %19 = OpConstant %9 1
4862 %24 = OpConstant %9 2
4863 %28 = OpTypeInt 64 0
4864 %29 = OpTypeImage %28 3D 0 0 0 2 R64ui
4865 %30 = OpTypePointer UniformConstant %29
4866 %31 = OpVariable %30 UniformConstant
4867 %33 = OpConstant %6 48
4868 %37 = OpTypeVector %6 3
4869 %50 = OpTypeInt 64 1
4870 %53 = OpTypePointer Image %28
4871 %56 = OpConstantComposite %10 %19 %19 %19
4872 %4 = OpFunction %2 None %3
4874 %8 = OpVariable %7 Function
4875 %18 = OpVariable %7 Function
4876 %23 = OpVariable %7 Function
4877 %15 = OpAccessChain %14 %12 %13
4879 %17 = OpBitcast %6 %16
4881 %20 = OpAccessChain %14 %12 %19
4883 %22 = OpBitcast %6 %21
4885 %25 = OpAccessChain %14 %12 %24
4887 %27 = OpBitcast %6 %26
4890 %34 = OpSMod %6 %32 %33
4893 %38 = OpCompositeConstruct %37 %34 %35 %36
4896 %41 = OpIMul %6 %39 %40
4899 %44 = OpIMul %6 %42 %43
4900 %45 = OpIAdd %6 %41 %44
4903 %48 = OpIMul %6 %46 %47
4904 %49 = OpIAdd %6 %45 %48
4905 %51 = OpSConvert %50 %49
4906 %52 = OpBitcast %28 %51
4907 %54 = OpImageTexelPointer %53 %31 %38 %13
4908 %55 = ${OPNAME} %28 %54 %19 %13 ${LASTARG:default=%52}
4913 const std::string kShader_3d_r64ui_intermediate_values = R"(
4914 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
4915 ; replaced with a template parameter and the last argument for it has been made optional.
4918 ; precision highp uimage3D;
4919 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
4920 ; #extension GL_EXT_shader_image_int64 : require
4922 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
4923 ; layout (r64ui, binding=0) coherent uniform uimage3D u_resultImage;
4924 ; layout (r64ui, binding=1) writeonly uniform uimage3D u_intermValuesImage;
4928 ; int gx = int(gl_GlobalInvocationID.x);
4929 ; int gy = int(gl_GlobalInvocationID.y);
4930 ; int gz = int(gl_GlobalInvocationID.z);
4931 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), u64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%48, gy, gz), uint(gx*gx + gy*gy + gz*gz))));
4936 ; Generator: Khronos Glslang Reference Front End; 8
4941 OpCapability Int64Atomics
4942 OpCapability Int64ImageEXT
4943 OpExtension "SPV_EXT_shader_image_int64"
4944 %1 = OpExtInstImport "GLSL.std.450"
4945 OpMemoryModel Logical GLSL450
4946 OpEntryPoint GLCompute %4 "main" %12
4947 OpExecutionMode %4 LocalSize 1 1 1
4948 OpDecorate %12 BuiltIn GlobalInvocationId
4949 OpDecorate %31 DescriptorSet 0
4950 OpDecorate %31 Binding 1
4951 OpDecorate %31 NonReadable
4952 OpDecorate %38 DescriptorSet 0
4953 OpDecorate %38 Binding 0
4954 OpDecorate %38 Coherent
4955 OpDecorate %64 BuiltIn WorkgroupSize
4957 %3 = OpTypeFunction %2
4959 %7 = OpTypePointer Function %6
4961 %10 = OpTypeVector %9 3
4962 %11 = OpTypePointer Input %10
4963 %12 = OpVariable %11 Input
4964 %13 = OpConstant %9 0
4965 %14 = OpTypePointer Input %9
4966 %19 = OpConstant %9 1
4967 %24 = OpConstant %9 2
4968 %28 = OpTypeInt 64 0
4969 %29 = OpTypeImage %28 3D 0 0 0 2 R64ui
4970 %30 = OpTypePointer UniformConstant %29
4971 %31 = OpVariable %30 UniformConstant
4972 %36 = OpTypeVector %6 3
4973 %38 = OpVariable %30 UniformConstant
4974 %40 = OpConstant %6 48
4975 %56 = OpTypeInt 64 1
4976 %59 = OpTypePointer Image %28
4977 %62 = OpTypeVector %28 4
4978 %64 = OpConstantComposite %10 %19 %19 %19
4979 %4 = OpFunction %2 None %3
4981 %8 = OpVariable %7 Function
4982 %18 = OpVariable %7 Function
4983 %23 = OpVariable %7 Function
4984 %15 = OpAccessChain %14 %12 %13
4986 %17 = OpBitcast %6 %16
4988 %20 = OpAccessChain %14 %12 %19
4990 %22 = OpBitcast %6 %21
4992 %25 = OpAccessChain %14 %12 %24
4994 %27 = OpBitcast %6 %26
4996 %32 = OpLoad %29 %31
5000 %37 = OpCompositeConstruct %36 %33 %34 %35
5002 %41 = OpSMod %6 %39 %40
5005 %44 = OpCompositeConstruct %36 %41 %42 %43
5008 %47 = OpIMul %6 %45 %46
5011 %50 = OpIMul %6 %48 %49
5012 %51 = OpIAdd %6 %47 %50
5015 %54 = OpIMul %6 %52 %53
5016 %55 = OpIAdd %6 %51 %54
5017 %57 = OpSConvert %56 %55
5018 %58 = OpBitcast %28 %57
5019 %60 = OpImageTexelPointer %59 %38 %44 %13
5020 %61 = ${OPNAME} %28 %60 %19 %13 ${LASTARG:default=%58}
5021 %63 = OpCompositeConstruct %62 %61 %61 %61 %61
5022 OpImageWrite %32 %37 %63
5027 const std::string kShader_3d_r64i_end_result = R"(
5028 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5029 ; replaced with a template parameter and the last argument for it has been made optional.
5032 ; precision highp iimage3D;
5033 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5034 ; #extension GL_EXT_shader_image_int64 : require
5036 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5037 ; layout (r64i, binding=0) coherent uniform iimage3D u_resultImage;
5041 ; int gx = int(gl_GlobalInvocationID.x);
5042 ; int gy = int(gl_GlobalInvocationID.y);
5043 ; int gz = int(gl_GlobalInvocationID.z);
5044 ; imageAtomicAdd(u_resultImage, ivec3(gx%48, gy, gz), int(gx*gx + gy*gy + gz*gz));
5049 ; Generator: Khronos Glslang Reference Front End; 8
5054 OpCapability Int64Atomics
5055 OpCapability Int64ImageEXT
5056 OpExtension "SPV_EXT_shader_image_int64"
5057 %1 = OpExtInstImport "GLSL.std.450"
5058 OpMemoryModel Logical GLSL450
5059 OpEntryPoint GLCompute %4 "main" %12
5060 OpExecutionMode %4 LocalSize 1 1 1
5061 OpDecorate %12 BuiltIn GlobalInvocationId
5062 OpDecorate %31 DescriptorSet 0
5063 OpDecorate %31 Binding 0
5064 OpDecorate %31 Coherent
5065 OpDecorate %54 BuiltIn WorkgroupSize
5067 %3 = OpTypeFunction %2
5069 %7 = OpTypePointer Function %6
5071 %10 = OpTypeVector %9 3
5072 %11 = OpTypePointer Input %10
5073 %12 = OpVariable %11 Input
5074 %13 = OpConstant %9 0
5075 %14 = OpTypePointer Input %9
5076 %19 = OpConstant %9 1
5077 %24 = OpConstant %9 2
5078 %28 = OpTypeInt 64 1
5079 %29 = OpTypeImage %28 3D 0 0 0 2 R64i
5080 %30 = OpTypePointer UniformConstant %29
5081 %31 = OpVariable %30 UniformConstant
5082 %33 = OpConstant %6 48
5083 %37 = OpTypeVector %6 3
5084 %51 = OpTypePointer Image %28
5085 %54 = OpConstantComposite %10 %19 %19 %19
5086 %4 = OpFunction %2 None %3
5088 %8 = OpVariable %7 Function
5089 %18 = OpVariable %7 Function
5090 %23 = OpVariable %7 Function
5091 %15 = OpAccessChain %14 %12 %13
5093 %17 = OpBitcast %6 %16
5095 %20 = OpAccessChain %14 %12 %19
5097 %22 = OpBitcast %6 %21
5099 %25 = OpAccessChain %14 %12 %24
5101 %27 = OpBitcast %6 %26
5104 %34 = OpSMod %6 %32 %33
5107 %38 = OpCompositeConstruct %37 %34 %35 %36
5110 %41 = OpIMul %6 %39 %40
5113 %44 = OpIMul %6 %42 %43
5114 %45 = OpIAdd %6 %41 %44
5117 %48 = OpIMul %6 %46 %47
5118 %49 = OpIAdd %6 %45 %48
5119 %50 = OpSConvert %28 %49
5120 %52 = OpImageTexelPointer %51 %31 %38 %13
5121 %53 = ${OPNAME} %28 %52 %19 %13 ${LASTARG:default=%50}
5126 const std::string kShader_3d_r64i_intermediate_values = R"(
5127 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5128 ; replaced with a template parameter and the last argument for it has been made optional.
5131 ; precision highp iimage3D;
5132 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5133 ; #extension GL_EXT_shader_image_int64 : require
5135 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5136 ; layout (r64i, binding=0) coherent uniform iimage3D u_resultImage;
5137 ; layout (r64i, binding=1) writeonly uniform iimage3D u_intermValuesImage;
5141 ; int gx = int(gl_GlobalInvocationID.x);
5142 ; int gy = int(gl_GlobalInvocationID.y);
5143 ; int gz = int(gl_GlobalInvocationID.z);
5144 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), i64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%48, gy, gz), int(gx*gx + gy*gy + gz*gz))));
5149 ; Generator: Khronos Glslang Reference Front End; 8
5154 OpCapability Int64Atomics
5155 OpCapability Int64ImageEXT
5156 OpExtension "SPV_EXT_shader_image_int64"
5157 %1 = OpExtInstImport "GLSL.std.450"
5158 OpMemoryModel Logical GLSL450
5159 OpEntryPoint GLCompute %4 "main" %12
5160 OpExecutionMode %4 LocalSize 1 1 1
5161 OpDecorate %12 BuiltIn GlobalInvocationId
5162 OpDecorate %31 DescriptorSet 0
5163 OpDecorate %31 Binding 1
5164 OpDecorate %31 NonReadable
5165 OpDecorate %38 DescriptorSet 0
5166 OpDecorate %38 Binding 0
5167 OpDecorate %38 Coherent
5168 OpDecorate %62 BuiltIn WorkgroupSize
5170 %3 = OpTypeFunction %2
5172 %7 = OpTypePointer Function %6
5174 %10 = OpTypeVector %9 3
5175 %11 = OpTypePointer Input %10
5176 %12 = OpVariable %11 Input
5177 %13 = OpConstant %9 0
5178 %14 = OpTypePointer Input %9
5179 %19 = OpConstant %9 1
5180 %24 = OpConstant %9 2
5181 %28 = OpTypeInt 64 1
5182 %29 = OpTypeImage %28 3D 0 0 0 2 R64i
5183 %30 = OpTypePointer UniformConstant %29
5184 %31 = OpVariable %30 UniformConstant
5185 %36 = OpTypeVector %6 3
5186 %38 = OpVariable %30 UniformConstant
5187 %40 = OpConstant %6 48
5188 %57 = OpTypePointer Image %28
5189 %60 = OpTypeVector %28 4
5190 %62 = OpConstantComposite %10 %19 %19 %19
5191 %4 = OpFunction %2 None %3
5193 %8 = OpVariable %7 Function
5194 %18 = OpVariable %7 Function
5195 %23 = OpVariable %7 Function
5196 %15 = OpAccessChain %14 %12 %13
5198 %17 = OpBitcast %6 %16
5200 %20 = OpAccessChain %14 %12 %19
5202 %22 = OpBitcast %6 %21
5204 %25 = OpAccessChain %14 %12 %24
5206 %27 = OpBitcast %6 %26
5208 %32 = OpLoad %29 %31
5212 %37 = OpCompositeConstruct %36 %33 %34 %35
5214 %41 = OpSMod %6 %39 %40
5217 %44 = OpCompositeConstruct %36 %41 %42 %43
5220 %47 = OpIMul %6 %45 %46
5223 %50 = OpIMul %6 %48 %49
5224 %51 = OpIAdd %6 %47 %50
5227 %54 = OpIMul %6 %52 %53
5228 %55 = OpIAdd %6 %51 %54
5229 %56 = OpSConvert %28 %55
5230 %58 = OpImageTexelPointer %57 %38 %44 %13
5231 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
5232 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
5233 OpImageWrite %32 %37 %61
5238 const std::string kShader_cube_r64ui_end_result = R"(
5239 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5240 ; replaced with a template parameter and the last argument for it has been made optional.
5243 ; precision highp uimageCube;
5244 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5245 ; #extension GL_EXT_shader_image_int64 : require
5247 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5248 ; layout (r64ui, binding=0) coherent uniform uimageCube u_resultImage;
5252 ; int gx = int(gl_GlobalInvocationID.x);
5253 ; int gy = int(gl_GlobalInvocationID.y);
5254 ; int gz = int(gl_GlobalInvocationID.z);
5255 ; imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz));
5260 ; Generator: Khronos Glslang Reference Front End; 8
5265 OpCapability Int64Atomics
5266 OpCapability Int64ImageEXT
5267 OpExtension "SPV_EXT_shader_image_int64"
5268 %1 = OpExtInstImport "GLSL.std.450"
5269 OpMemoryModel Logical GLSL450
5270 OpEntryPoint GLCompute %4 "main" %12
5271 OpExecutionMode %4 LocalSize 1 1 1
5272 OpDecorate %12 BuiltIn GlobalInvocationId
5273 OpDecorate %31 DescriptorSet 0
5274 OpDecorate %31 Binding 0
5275 OpDecorate %31 Coherent
5276 OpDecorate %56 BuiltIn WorkgroupSize
5278 %3 = OpTypeFunction %2
5280 %7 = OpTypePointer Function %6
5282 %10 = OpTypeVector %9 3
5283 %11 = OpTypePointer Input %10
5284 %12 = OpVariable %11 Input
5285 %13 = OpConstant %9 0
5286 %14 = OpTypePointer Input %9
5287 %19 = OpConstant %9 1
5288 %24 = OpConstant %9 2
5289 %28 = OpTypeInt 64 0
5290 %29 = OpTypeImage %28 Cube 0 0 0 2 R64ui
5291 %30 = OpTypePointer UniformConstant %29
5292 %31 = OpVariable %30 UniformConstant
5293 %33 = OpConstant %6 64
5294 %37 = OpTypeVector %6 3
5295 %50 = OpTypeInt 64 1
5296 %53 = OpTypePointer Image %28
5297 %56 = OpConstantComposite %10 %19 %19 %19
5298 %4 = OpFunction %2 None %3
5300 %8 = OpVariable %7 Function
5301 %18 = OpVariable %7 Function
5302 %23 = OpVariable %7 Function
5303 %15 = OpAccessChain %14 %12 %13
5305 %17 = OpBitcast %6 %16
5307 %20 = OpAccessChain %14 %12 %19
5309 %22 = OpBitcast %6 %21
5311 %25 = OpAccessChain %14 %12 %24
5313 %27 = OpBitcast %6 %26
5316 %34 = OpSMod %6 %32 %33
5319 %38 = OpCompositeConstruct %37 %34 %35 %36
5322 %41 = OpIMul %6 %39 %40
5325 %44 = OpIMul %6 %42 %43
5326 %45 = OpIAdd %6 %41 %44
5329 %48 = OpIMul %6 %46 %47
5330 %49 = OpIAdd %6 %45 %48
5331 %51 = OpSConvert %50 %49
5332 %52 = OpBitcast %28 %51
5333 %54 = OpImageTexelPointer %53 %31 %38 %13
5334 %55 = ${OPNAME} %28 %54 %19 %13 ${LASTARG:default=%52}
5339 const std::string kShader_cube_r64ui_intermediate_values = R"(
5340 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5341 ; replaced with a template parameter and the last argument for it has been made optional.
5344 ; precision highp uimageCube;
5345 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5346 ; #extension GL_EXT_shader_image_int64 : require
5348 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5349 ; layout (r64ui, binding=0) coherent uniform uimageCube u_resultImage;
5350 ; layout (r64ui, binding=1) writeonly uniform uimageCube u_intermValuesImage;
5354 ; int gx = int(gl_GlobalInvocationID.x);
5355 ; int gy = int(gl_GlobalInvocationID.y);
5356 ; int gz = int(gl_GlobalInvocationID.z);
5357 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), u64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz))));
5362 ; Generator: Khronos Glslang Reference Front End; 8
5367 OpCapability Int64Atomics
5368 OpCapability Int64ImageEXT
5369 OpExtension "SPV_EXT_shader_image_int64"
5370 %1 = OpExtInstImport "GLSL.std.450"
5371 OpMemoryModel Logical GLSL450
5372 OpEntryPoint GLCompute %4 "main" %12
5373 OpExecutionMode %4 LocalSize 1 1 1
5374 OpDecorate %12 BuiltIn GlobalInvocationId
5375 OpDecorate %31 DescriptorSet 0
5376 OpDecorate %31 Binding 1
5377 OpDecorate %31 NonReadable
5378 OpDecorate %38 DescriptorSet 0
5379 OpDecorate %38 Binding 0
5380 OpDecorate %38 Coherent
5381 OpDecorate %64 BuiltIn WorkgroupSize
5383 %3 = OpTypeFunction %2
5385 %7 = OpTypePointer Function %6
5387 %10 = OpTypeVector %9 3
5388 %11 = OpTypePointer Input %10
5389 %12 = OpVariable %11 Input
5390 %13 = OpConstant %9 0
5391 %14 = OpTypePointer Input %9
5392 %19 = OpConstant %9 1
5393 %24 = OpConstant %9 2
5394 %28 = OpTypeInt 64 0
5395 %29 = OpTypeImage %28 Cube 0 0 0 2 R64ui
5396 %30 = OpTypePointer UniformConstant %29
5397 %31 = OpVariable %30 UniformConstant
5398 %36 = OpTypeVector %6 3
5399 %38 = OpVariable %30 UniformConstant
5400 %40 = OpConstant %6 64
5401 %56 = OpTypeInt 64 1
5402 %59 = OpTypePointer Image %28
5403 %62 = OpTypeVector %28 4
5404 %64 = OpConstantComposite %10 %19 %19 %19
5405 %4 = OpFunction %2 None %3
5407 %8 = OpVariable %7 Function
5408 %18 = OpVariable %7 Function
5409 %23 = OpVariable %7 Function
5410 %15 = OpAccessChain %14 %12 %13
5412 %17 = OpBitcast %6 %16
5414 %20 = OpAccessChain %14 %12 %19
5416 %22 = OpBitcast %6 %21
5418 %25 = OpAccessChain %14 %12 %24
5420 %27 = OpBitcast %6 %26
5422 %32 = OpLoad %29 %31
5426 %37 = OpCompositeConstruct %36 %33 %34 %35
5428 %41 = OpSMod %6 %39 %40
5431 %44 = OpCompositeConstruct %36 %41 %42 %43
5434 %47 = OpIMul %6 %45 %46
5437 %50 = OpIMul %6 %48 %49
5438 %51 = OpIAdd %6 %47 %50
5441 %54 = OpIMul %6 %52 %53
5442 %55 = OpIAdd %6 %51 %54
5443 %57 = OpSConvert %56 %55
5444 %58 = OpBitcast %28 %57
5445 %60 = OpImageTexelPointer %59 %38 %44 %13
5446 %61 = ${OPNAME} %28 %60 %19 %13 ${LASTARG:default=%58}
5447 %63 = OpCompositeConstruct %62 %61 %61 %61 %61
5448 OpImageWrite %32 %37 %63
5453 const std::string kShader_cube_r64i_end_result = R"(
5454 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5455 ; replaced with a template parameter and the last argument for it has been made optional.
5458 ; precision highp iimageCube;
5459 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5460 ; #extension GL_EXT_shader_image_int64 : require
5462 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5463 ; layout (r64i, binding=0) coherent uniform iimageCube u_resultImage;
5467 ; int gx = int(gl_GlobalInvocationID.x);
5468 ; int gy = int(gl_GlobalInvocationID.y);
5469 ; int gz = int(gl_GlobalInvocationID.z);
5470 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64, gy, gz), int(gx*gx + gy*gy + gz*gz));
5475 ; Generator: Khronos Glslang Reference Front End; 8
5480 OpCapability Int64Atomics
5481 OpCapability Int64ImageEXT
5482 OpExtension "SPV_EXT_shader_image_int64"
5483 %1 = OpExtInstImport "GLSL.std.450"
5484 OpMemoryModel Logical GLSL450
5485 OpEntryPoint GLCompute %4 "main" %12
5486 OpExecutionMode %4 LocalSize 1 1 1
5487 OpDecorate %12 BuiltIn GlobalInvocationId
5488 OpDecorate %31 DescriptorSet 0
5489 OpDecorate %31 Binding 0
5490 OpDecorate %31 Coherent
5491 OpDecorate %54 BuiltIn WorkgroupSize
5493 %3 = OpTypeFunction %2
5495 %7 = OpTypePointer Function %6
5497 %10 = OpTypeVector %9 3
5498 %11 = OpTypePointer Input %10
5499 %12 = OpVariable %11 Input
5500 %13 = OpConstant %9 0
5501 %14 = OpTypePointer Input %9
5502 %19 = OpConstant %9 1
5503 %24 = OpConstant %9 2
5504 %28 = OpTypeInt 64 1
5505 %29 = OpTypeImage %28 Cube 0 0 0 2 R64i
5506 %30 = OpTypePointer UniformConstant %29
5507 %31 = OpVariable %30 UniformConstant
5508 %33 = OpConstant %6 64
5509 %37 = OpTypeVector %6 3
5510 %51 = OpTypePointer Image %28
5511 %54 = OpConstantComposite %10 %19 %19 %19
5512 %4 = OpFunction %2 None %3
5514 %8 = OpVariable %7 Function
5515 %18 = OpVariable %7 Function
5516 %23 = OpVariable %7 Function
5517 %15 = OpAccessChain %14 %12 %13
5519 %17 = OpBitcast %6 %16
5521 %20 = OpAccessChain %14 %12 %19
5523 %22 = OpBitcast %6 %21
5525 %25 = OpAccessChain %14 %12 %24
5527 %27 = OpBitcast %6 %26
5530 %34 = OpSMod %6 %32 %33
5533 %38 = OpCompositeConstruct %37 %34 %35 %36
5536 %41 = OpIMul %6 %39 %40
5539 %44 = OpIMul %6 %42 %43
5540 %45 = OpIAdd %6 %41 %44
5543 %48 = OpIMul %6 %46 %47
5544 %49 = OpIAdd %6 %45 %48
5545 %50 = OpSConvert %28 %49
5546 %52 = OpImageTexelPointer %51 %31 %38 %13
5547 %53 = ${OPNAME} %28 %52 %19 %13 ${LASTARG:default=%50}
5552 const std::string kShader_cube_r64i_intermediate_values = R"(
5553 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5554 ; replaced with a template parameter and the last argument for it has been made optional.
5557 ; precision highp iimageCube;
5558 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5559 ; #extension GL_EXT_shader_image_int64 : require
5561 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5562 ; layout (r64i, binding=0) coherent uniform iimageCube u_resultImage;
5563 ; layout (r64i, binding=1) writeonly uniform iimageCube u_intermValuesImage;
5567 ; int gx = int(gl_GlobalInvocationID.x);
5568 ; int gy = int(gl_GlobalInvocationID.y);
5569 ; int gz = int(gl_GlobalInvocationID.z);
5570 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), i64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), int(gx*gx + gy*gy + gz*gz))));
5575 ; Generator: Khronos Glslang Reference Front End; 8
5580 OpCapability Int64Atomics
5581 OpCapability Int64ImageEXT
5582 OpExtension "SPV_EXT_shader_image_int64"
5583 %1 = OpExtInstImport "GLSL.std.450"
5584 OpMemoryModel Logical GLSL450
5585 OpEntryPoint GLCompute %4 "main" %12
5586 OpExecutionMode %4 LocalSize 1 1 1
5587 OpDecorate %12 BuiltIn GlobalInvocationId
5588 OpDecorate %31 DescriptorSet 0
5589 OpDecorate %31 Binding 1
5590 OpDecorate %31 NonReadable
5591 OpDecorate %38 DescriptorSet 0
5592 OpDecorate %38 Binding 0
5593 OpDecorate %38 Coherent
5594 OpDecorate %62 BuiltIn WorkgroupSize
5596 %3 = OpTypeFunction %2
5598 %7 = OpTypePointer Function %6
5600 %10 = OpTypeVector %9 3
5601 %11 = OpTypePointer Input %10
5602 %12 = OpVariable %11 Input
5603 %13 = OpConstant %9 0
5604 %14 = OpTypePointer Input %9
5605 %19 = OpConstant %9 1
5606 %24 = OpConstant %9 2
5607 %28 = OpTypeInt 64 1
5608 %29 = OpTypeImage %28 Cube 0 0 0 2 R64i
5609 %30 = OpTypePointer UniformConstant %29
5610 %31 = OpVariable %30 UniformConstant
5611 %36 = OpTypeVector %6 3
5612 %38 = OpVariable %30 UniformConstant
5613 %40 = OpConstant %6 64
5614 %57 = OpTypePointer Image %28
5615 %60 = OpTypeVector %28 4
5616 %62 = OpConstantComposite %10 %19 %19 %19
5617 %4 = OpFunction %2 None %3
5619 %8 = OpVariable %7 Function
5620 %18 = OpVariable %7 Function
5621 %23 = OpVariable %7 Function
5622 %15 = OpAccessChain %14 %12 %13
5624 %17 = OpBitcast %6 %16
5626 %20 = OpAccessChain %14 %12 %19
5628 %22 = OpBitcast %6 %21
5630 %25 = OpAccessChain %14 %12 %24
5632 %27 = OpBitcast %6 %26
5634 %32 = OpLoad %29 %31
5638 %37 = OpCompositeConstruct %36 %33 %34 %35
5640 %41 = OpSMod %6 %39 %40
5643 %44 = OpCompositeConstruct %36 %41 %42 %43
5646 %47 = OpIMul %6 %45 %46
5649 %50 = OpIMul %6 %48 %49
5650 %51 = OpIAdd %6 %47 %50
5653 %54 = OpIMul %6 %52 %53
5654 %55 = OpIAdd %6 %51 %54
5655 %56 = OpSConvert %28 %55
5656 %58 = OpImageTexelPointer %57 %38 %44 %13
5657 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
5658 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
5659 OpImageWrite %32 %37 %61
5664 const std::string kShader_cube_array_r64ui_end_result = R"(
5665 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5666 ; replaced with a template parameter and the last argument for it has been made optional.
5669 ; precision highp uimageCubeArray;
5670 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5671 ; #extension GL_EXT_shader_image_int64 : require
5673 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5674 ; layout (r64ui, binding=0) coherent uniform uimageCubeArray u_resultImage;
5678 ; int gx = int(gl_GlobalInvocationID.x);
5679 ; int gy = int(gl_GlobalInvocationID.y);
5680 ; int gz = int(gl_GlobalInvocationID.z);
5681 ; imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz));
5686 ; Generator: Khronos Glslang Reference Front End; 8
5691 OpCapability Int64Atomics
5692 OpCapability ImageCubeArray
5693 OpCapability Int64ImageEXT
5694 OpExtension "SPV_EXT_shader_image_int64"
5695 %1 = OpExtInstImport "GLSL.std.450"
5696 OpMemoryModel Logical GLSL450
5697 OpEntryPoint GLCompute %4 "main" %12
5698 OpExecutionMode %4 LocalSize 1 1 1
5699 OpDecorate %12 BuiltIn GlobalInvocationId
5700 OpDecorate %31 DescriptorSet 0
5701 OpDecorate %31 Binding 0
5702 OpDecorate %31 Coherent
5703 OpDecorate %56 BuiltIn WorkgroupSize
5705 %3 = OpTypeFunction %2
5707 %7 = OpTypePointer Function %6
5709 %10 = OpTypeVector %9 3
5710 %11 = OpTypePointer Input %10
5711 %12 = OpVariable %11 Input
5712 %13 = OpConstant %9 0
5713 %14 = OpTypePointer Input %9
5714 %19 = OpConstant %9 1
5715 %24 = OpConstant %9 2
5716 %28 = OpTypeInt 64 0
5717 %29 = OpTypeImage %28 Cube 0 1 0 2 R64ui
5718 %30 = OpTypePointer UniformConstant %29
5719 %31 = OpVariable %30 UniformConstant
5720 %33 = OpConstant %6 64
5721 %37 = OpTypeVector %6 3
5722 %50 = OpTypeInt 64 1
5723 %53 = OpTypePointer Image %28
5724 %56 = OpConstantComposite %10 %19 %19 %19
5725 %4 = OpFunction %2 None %3
5727 %8 = OpVariable %7 Function
5728 %18 = OpVariable %7 Function
5729 %23 = OpVariable %7 Function
5730 %15 = OpAccessChain %14 %12 %13
5732 %17 = OpBitcast %6 %16
5734 %20 = OpAccessChain %14 %12 %19
5736 %22 = OpBitcast %6 %21
5738 %25 = OpAccessChain %14 %12 %24
5740 %27 = OpBitcast %6 %26
5743 %34 = OpSMod %6 %32 %33
5746 %38 = OpCompositeConstruct %37 %34 %35 %36
5749 %41 = OpIMul %6 %39 %40
5752 %44 = OpIMul %6 %42 %43
5753 %45 = OpIAdd %6 %41 %44
5756 %48 = OpIMul %6 %46 %47
5757 %49 = OpIAdd %6 %45 %48
5758 %51 = OpSConvert %50 %49
5759 %52 = OpBitcast %28 %51
5760 %54 = OpImageTexelPointer %53 %31 %38 %13
5761 %55 = ${OPNAME} %28 %54 %19 %13 ${LASTARG:default=%52}
5766 const std::string kShader_cube_array_r64ui_intermediate_values = R"(
5767 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5768 ; replaced with a template parameter and the last argument for it has been made optional.
5771 ; precision highp uimageCubeArray;
5772 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5773 ; #extension GL_EXT_shader_image_int64 : require
5775 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5776 ; layout (r64ui, binding=0) coherent uniform uimageCubeArray u_resultImage;
5777 ; layout (r64ui, binding=1) writeonly uniform uimageCubeArray u_intermValuesImage;
5781 ; int gx = int(gl_GlobalInvocationID.x);
5782 ; int gy = int(gl_GlobalInvocationID.y);
5783 ; int gz = int(gl_GlobalInvocationID.z);
5784 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), u64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), uint(gx*gx + gy*gy + gz*gz))));
5789 ; Generator: Khronos Glslang Reference Front End; 8
5794 OpCapability Int64Atomics
5795 OpCapability ImageCubeArray
5796 OpCapability Int64ImageEXT
5797 OpExtension "SPV_EXT_shader_image_int64"
5798 %1 = OpExtInstImport "GLSL.std.450"
5799 OpMemoryModel Logical GLSL450
5800 OpEntryPoint GLCompute %4 "main" %12
5801 OpExecutionMode %4 LocalSize 1 1 1
5802 OpDecorate %12 BuiltIn GlobalInvocationId
5803 OpDecorate %31 DescriptorSet 0
5804 OpDecorate %31 Binding 1
5805 OpDecorate %31 NonReadable
5806 OpDecorate %38 DescriptorSet 0
5807 OpDecorate %38 Binding 0
5808 OpDecorate %38 Coherent
5809 OpDecorate %64 BuiltIn WorkgroupSize
5811 %3 = OpTypeFunction %2
5813 %7 = OpTypePointer Function %6
5815 %10 = OpTypeVector %9 3
5816 %11 = OpTypePointer Input %10
5817 %12 = OpVariable %11 Input
5818 %13 = OpConstant %9 0
5819 %14 = OpTypePointer Input %9
5820 %19 = OpConstant %9 1
5821 %24 = OpConstant %9 2
5822 %28 = OpTypeInt 64 0
5823 %29 = OpTypeImage %28 Cube 0 1 0 2 R64ui
5824 %30 = OpTypePointer UniformConstant %29
5825 %31 = OpVariable %30 UniformConstant
5826 %36 = OpTypeVector %6 3
5827 %38 = OpVariable %30 UniformConstant
5828 %40 = OpConstant %6 64
5829 %56 = OpTypeInt 64 1
5830 %59 = OpTypePointer Image %28
5831 %62 = OpTypeVector %28 4
5832 %64 = OpConstantComposite %10 %19 %19 %19
5833 %4 = OpFunction %2 None %3
5835 %8 = OpVariable %7 Function
5836 %18 = OpVariable %7 Function
5837 %23 = OpVariable %7 Function
5838 %15 = OpAccessChain %14 %12 %13
5840 %17 = OpBitcast %6 %16
5842 %20 = OpAccessChain %14 %12 %19
5844 %22 = OpBitcast %6 %21
5846 %25 = OpAccessChain %14 %12 %24
5848 %27 = OpBitcast %6 %26
5850 %32 = OpLoad %29 %31
5854 %37 = OpCompositeConstruct %36 %33 %34 %35
5856 %41 = OpSMod %6 %39 %40
5859 %44 = OpCompositeConstruct %36 %41 %42 %43
5862 %47 = OpIMul %6 %45 %46
5865 %50 = OpIMul %6 %48 %49
5866 %51 = OpIAdd %6 %47 %50
5869 %54 = OpIMul %6 %52 %53
5870 %55 = OpIAdd %6 %51 %54
5871 %57 = OpSConvert %56 %55
5872 %58 = OpBitcast %28 %57
5873 %60 = OpImageTexelPointer %59 %38 %44 %13
5874 %61 = ${OPNAME} %28 %60 %19 %13 ${LASTARG:default=%58}
5875 %63 = OpCompositeConstruct %62 %61 %61 %61 %61
5876 OpImageWrite %32 %37 %63
5881 const std::string kShader_cube_array_r64i_end_result = R"(
5882 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5883 ; replaced with a template parameter and the last argument for it has been made optional.
5886 ; precision highp iimageCubeArray;
5887 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5888 ; #extension GL_EXT_shader_image_int64 : require
5890 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5891 ; layout (r64i, binding=0) coherent uniform iimageCubeArray u_resultImage;
5895 ; int gx = int(gl_GlobalInvocationID.x);
5896 ; int gy = int(gl_GlobalInvocationID.y);
5897 ; int gz = int(gl_GlobalInvocationID.z);
5898 ; imageAtomicAdd(u_resultImage, ivec3(gx % 64, gy, gz), int(gx*gx + gy*gy + gz*gz));
5903 ; Generator: Khronos Glslang Reference Front End; 8
5908 OpCapability Int64Atomics
5909 OpCapability ImageCubeArray
5910 OpCapability Int64ImageEXT
5911 OpExtension "SPV_EXT_shader_image_int64"
5912 %1 = OpExtInstImport "GLSL.std.450"
5913 OpMemoryModel Logical GLSL450
5914 OpEntryPoint GLCompute %4 "main" %12
5915 OpExecutionMode %4 LocalSize 1 1 1
5916 OpDecorate %12 BuiltIn GlobalInvocationId
5917 OpDecorate %31 DescriptorSet 0
5918 OpDecorate %31 Binding 0
5919 OpDecorate %31 Coherent
5920 OpDecorate %54 BuiltIn WorkgroupSize
5922 %3 = OpTypeFunction %2
5924 %7 = OpTypePointer Function %6
5926 %10 = OpTypeVector %9 3
5927 %11 = OpTypePointer Input %10
5928 %12 = OpVariable %11 Input
5929 %13 = OpConstant %9 0
5930 %14 = OpTypePointer Input %9
5931 %19 = OpConstant %9 1
5932 %24 = OpConstant %9 2
5933 %28 = OpTypeInt 64 1
5934 %29 = OpTypeImage %28 Cube 0 1 0 2 R64i
5935 %30 = OpTypePointer UniformConstant %29
5936 %31 = OpVariable %30 UniformConstant
5937 %33 = OpConstant %6 64
5938 %37 = OpTypeVector %6 3
5939 %51 = OpTypePointer Image %28
5940 %54 = OpConstantComposite %10 %19 %19 %19
5941 %4 = OpFunction %2 None %3
5943 %8 = OpVariable %7 Function
5944 %18 = OpVariable %7 Function
5945 %23 = OpVariable %7 Function
5946 %15 = OpAccessChain %14 %12 %13
5948 %17 = OpBitcast %6 %16
5950 %20 = OpAccessChain %14 %12 %19
5952 %22 = OpBitcast %6 %21
5954 %25 = OpAccessChain %14 %12 %24
5956 %27 = OpBitcast %6 %26
5959 %34 = OpSMod %6 %32 %33
5962 %38 = OpCompositeConstruct %37 %34 %35 %36
5965 %41 = OpIMul %6 %39 %40
5968 %44 = OpIMul %6 %42 %43
5969 %45 = OpIAdd %6 %41 %44
5972 %48 = OpIMul %6 %46 %47
5973 %49 = OpIAdd %6 %45 %48
5974 %50 = OpSConvert %28 %49
5975 %52 = OpImageTexelPointer %51 %31 %38 %13
5976 %53 = ${OPNAME} %28 %52 %19 %13 ${LASTARG:default=%50}
5981 const std::string kShader_cube_array_r64i_intermediate_values = R"(
5982 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
5983 ; replaced with a template parameter and the last argument for it has been made optional.
5986 ; precision highp iimageCubeArray;
5987 ; #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
5988 ; #extension GL_EXT_shader_image_int64 : require
5990 ; layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
5991 ; layout (r64i, binding=0) coherent uniform iimageCubeArray u_resultImage;
5992 ; layout (r64i, binding=1) writeonly uniform iimageCubeArray u_intermValuesImage;
5996 ; int gx = int(gl_GlobalInvocationID.x);
5997 ; int gy = int(gl_GlobalInvocationID.y);
5998 ; int gz = int(gl_GlobalInvocationID.z);
5999 ; imageStore(u_intermValuesImage, ivec3(gx, gy, gz), i64vec4(imageAtomicAdd(u_resultImage, ivec3(gx%64, gy, gz), int(gx*gx + gy*gy + gz*gz))));
6004 ; Generator: Khronos Glslang Reference Front End; 8
6009 OpCapability Int64Atomics
6010 OpCapability ImageCubeArray
6011 OpCapability Int64ImageEXT
6012 OpExtension "SPV_EXT_shader_image_int64"
6013 %1 = OpExtInstImport "GLSL.std.450"
6014 OpMemoryModel Logical GLSL450
6015 OpEntryPoint GLCompute %4 "main" %12
6016 OpExecutionMode %4 LocalSize 1 1 1
6017 OpDecorate %12 BuiltIn GlobalInvocationId
6018 OpDecorate %31 DescriptorSet 0
6019 OpDecorate %31 Binding 1
6020 OpDecorate %31 NonReadable
6021 OpDecorate %38 DescriptorSet 0
6022 OpDecorate %38 Binding 0
6023 OpDecorate %38 Coherent
6024 OpDecorate %62 BuiltIn WorkgroupSize
6026 %3 = OpTypeFunction %2
6028 %7 = OpTypePointer Function %6
6030 %10 = OpTypeVector %9 3
6031 %11 = OpTypePointer Input %10
6032 %12 = OpVariable %11 Input
6033 %13 = OpConstant %9 0
6034 %14 = OpTypePointer Input %9
6035 %19 = OpConstant %9 1
6036 %24 = OpConstant %9 2
6037 %28 = OpTypeInt 64 1
6038 %29 = OpTypeImage %28 Cube 0 1 0 2 R64i
6039 %30 = OpTypePointer UniformConstant %29
6040 %31 = OpVariable %30 UniformConstant
6041 %36 = OpTypeVector %6 3
6042 %38 = OpVariable %30 UniformConstant
6043 %40 = OpConstant %6 64
6044 %57 = OpTypePointer Image %28
6045 %60 = OpTypeVector %28 4
6046 %62 = OpConstantComposite %10 %19 %19 %19
6047 %4 = OpFunction %2 None %3
6049 %8 = OpVariable %7 Function
6050 %18 = OpVariable %7 Function
6051 %23 = OpVariable %7 Function
6052 %15 = OpAccessChain %14 %12 %13
6054 %17 = OpBitcast %6 %16
6056 %20 = OpAccessChain %14 %12 %19
6058 %22 = OpBitcast %6 %21
6060 %25 = OpAccessChain %14 %12 %24
6062 %27 = OpBitcast %6 %26
6064 %32 = OpLoad %29 %31
6068 %37 = OpCompositeConstruct %36 %33 %34 %35
6070 %41 = OpSMod %6 %39 %40
6073 %44 = OpCompositeConstruct %36 %41 %42 %43
6076 %47 = OpIMul %6 %45 %46
6079 %50 = OpIMul %6 %48 %49
6080 %51 = OpIAdd %6 %47 %50
6083 %54 = OpIMul %6 %52 %53
6084 %55 = OpIAdd %6 %51 %54
6085 %56 = OpSConvert %28 %55
6086 %58 = OpImageTexelPointer %57 %38 %44 %13
6087 %59 = ${OPNAME} %28 %58 %19 %13 ${LASTARG:default=%56}
6088 %61 = OpCompositeConstruct %60 %59 %59 %59 %59
6089 OpImageWrite %32 %37 %61
6094 const std::string kShader_image_buffer_r64ui_end_result = R"(
6095 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
6096 ; replaced with a template parameter and the last argument for it has been made optional.
6099 ;precision highp uimageBuffer;
6100 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
6101 ;#extension GL_EXT_shader_image_int64 : require
6103 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
6104 ;layout (r64ui, binding=0) coherent uniform uimageBuffer u_resultImage;
6108 ; int gx = int(gl_GlobalInvocationID.x);
6109 ; int gy = int(gl_GlobalInvocationID.y);
6110 ; int gz = int(gl_GlobalInvocationID.z);
6111 ; imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz));
6116 ; Generator: Khronos Glslang Reference Front End; 8
6121 OpCapability Int64Atomics
6122 OpCapability ImageBuffer
6123 OpCapability Int64ImageEXT
6124 OpExtension "SPV_EXT_shader_image_int64"
6125 %1 = OpExtInstImport "GLSL.std.450"
6126 OpMemoryModel Logical GLSL450
6127 OpEntryPoint GLCompute %4 "main" %12
6128 OpExecutionMode %4 LocalSize 1 1 1
6129 OpDecorate %12 BuiltIn GlobalInvocationId
6130 OpDecorate %31 DescriptorSet 0
6131 OpDecorate %31 Binding 0
6132 OpDecorate %31 Coherent
6133 OpDecorate %52 BuiltIn WorkgroupSize
6135 %3 = OpTypeFunction %2
6137 %7 = OpTypePointer Function %6
6139 %10 = OpTypeVector %9 3
6140 %11 = OpTypePointer Input %10
6141 %12 = OpVariable %11 Input
6142 %13 = OpConstant %9 0
6143 %14 = OpTypePointer Input %9
6144 %19 = OpConstant %9 1
6145 %24 = OpConstant %9 2
6146 %28 = OpTypeInt 64 0
6147 %29 = OpTypeImage %28 Buffer 0 0 0 2 R64ui
6148 %30 = OpTypePointer UniformConstant %29
6149 %31 = OpVariable %30 UniformConstant
6150 %33 = OpConstant %6 64
6151 %46 = OpTypeInt 64 1
6152 %49 = OpTypePointer Image %28
6153 %52 = OpConstantComposite %10 %19 %19 %19
6154 %4 = OpFunction %2 None %3
6156 %8 = OpVariable %7 Function
6157 %18 = OpVariable %7 Function
6158 %23 = OpVariable %7 Function
6159 %15 = OpAccessChain %14 %12 %13
6161 %17 = OpBitcast %6 %16
6163 %20 = OpAccessChain %14 %12 %19
6165 %22 = OpBitcast %6 %21
6167 %25 = OpAccessChain %14 %12 %24
6169 %27 = OpBitcast %6 %26
6172 %34 = OpSMod %6 %32 %33
6175 %37 = OpIMul %6 %35 %36
6178 %40 = OpIMul %6 %38 %39
6179 %41 = OpIAdd %6 %37 %40
6182 %44 = OpIMul %6 %42 %43
6183 %45 = OpIAdd %6 %41 %44
6184 %47 = OpSConvert %46 %45
6185 %48 = OpBitcast %28 %47
6186 %50 = OpImageTexelPointer %49 %31 %34 %13
6187 %51 = ${OPNAME} %28 %50 %19 %13 ${LASTARG:default=%48}
6192 const std::string kShader_image_buffer_r64ui_intermediate_values = R"(
6193 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
6194 ; replaced with a template parameter and the last argument for it has been made optional.
6197 ;precision highp uimageBuffer;
6199 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
6200 ;#extension GL_EXT_shader_image_int64 : require
6201 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
6202 ;layout (r64ui, binding=0) coherent uniform uimageBuffer u_resultImage;
6203 ;layout (r64ui, binding=1) writeonly uniform uimageBuffer u_intermValuesImage;
6207 ; int gx = int(gl_GlobalInvocationID.x);
6208 ; int gy = int(gl_GlobalInvocationID.y);
6209 ; int gz = int(gl_GlobalInvocationID.z);
6210 ; imageStore(u_intermValuesImage, gx, u64vec4(imageAtomicAdd(u_resultImage, gx % 64, uint(gx*gx + gy*gy + gz*gz))));
6215 ; Generator: Khronos Glslang Reference Front End; 8
6220 OpCapability Int64Atomics
6221 OpCapability ImageBuffer
6222 OpCapability Int64ImageEXT
6223 OpExtension "SPV_EXT_shader_image_int64"
6224 %1 = OpExtInstImport "GLSL.std.450"
6225 OpMemoryModel Logical GLSL450
6226 OpEntryPoint GLCompute %4 "main" %12
6227 OpExecutionMode %4 LocalSize 1 1 1
6228 OpDecorate %12 BuiltIn GlobalInvocationId
6229 OpDecorate %31 DescriptorSet 0
6230 OpDecorate %31 Binding 1
6231 OpDecorate %31 NonReadable
6232 OpDecorate %34 DescriptorSet 0
6233 OpDecorate %34 Binding 0
6234 OpDecorate %34 Coherent
6235 OpDecorate %57 BuiltIn WorkgroupSize
6237 %3 = OpTypeFunction %2
6239 %7 = OpTypePointer Function %6
6241 %10 = OpTypeVector %9 3
6242 %11 = OpTypePointer Input %10
6243 %12 = OpVariable %11 Input
6244 %13 = OpConstant %9 0
6245 %14 = OpTypePointer Input %9
6246 %19 = OpConstant %9 1
6247 %24 = OpConstant %9 2
6248 %28 = OpTypeInt 64 0
6249 %29 = OpTypeImage %28 Buffer 0 0 0 2 R64ui
6250 %30 = OpTypePointer UniformConstant %29
6251 %31 = OpVariable %30 UniformConstant
6252 %34 = OpVariable %30 UniformConstant
6253 %36 = OpConstant %6 64
6254 %49 = OpTypeInt 64 1
6255 %52 = OpTypePointer Image %28
6256 %55 = OpTypeVector %28 4
6257 %57 = OpConstantComposite %10 %19 %19 %19
6258 %4 = OpFunction %2 None %3
6260 %8 = OpVariable %7 Function
6261 %18 = OpVariable %7 Function
6262 %23 = OpVariable %7 Function
6263 %15 = OpAccessChain %14 %12 %13
6265 %17 = OpBitcast %6 %16
6267 %20 = OpAccessChain %14 %12 %19
6269 %22 = OpBitcast %6 %21
6271 %25 = OpAccessChain %14 %12 %24
6273 %27 = OpBitcast %6 %26
6275 %32 = OpLoad %29 %31
6278 %37 = OpSMod %6 %35 %36
6281 %40 = OpIMul %6 %38 %39
6284 %43 = OpIMul %6 %41 %42
6285 %44 = OpIAdd %6 %40 %43
6288 %47 = OpIMul %6 %45 %46
6289 %48 = OpIAdd %6 %44 %47
6290 %50 = OpSConvert %49 %48
6291 %51 = OpBitcast %28 %50
6292 %53 = OpImageTexelPointer %52 %34 %37 %13
6293 %54 = ${OPNAME} %28 %53 %19 %13 ${LASTARG:default=%51}
6294 %56 = OpCompositeConstruct %55 %54 %54 %54 %54
6295 OpImageWrite %32 %33 %56
6300 const std::string kShader_image_buffer_r64i_end_result = R"(
6301 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
6302 ; replaced with a template parameter and the last argument for it has been made optional.
6305 ;precision highp iimageBuffer;
6306 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
6307 ;#extension GL_EXT_shader_image_int64 : require
6309 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
6310 ;layout (r64i, binding=0) coherent uniform iimageBuffer u_resultImage;
6314 ; int gx = int(gl_GlobalInvocationID.x);
6315 ; int gy = int(gl_GlobalInvocationID.y);
6316 ; int gz = int(gl_GlobalInvocationID.z);
6317 ; imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz));
6322 ; Generator: Khronos Glslang Reference Front End; 8
6327 OpCapability Int64Atomics
6328 OpCapability ImageBuffer
6329 OpCapability Int64ImageEXT
6330 OpExtension "SPV_EXT_shader_image_int64"
6331 %1 = OpExtInstImport "GLSL.std.450"
6332 OpMemoryModel Logical GLSL450
6333 OpEntryPoint GLCompute %4 "main" %12
6334 OpExecutionMode %4 LocalSize 1 1 1
6335 OpDecorate %12 BuiltIn GlobalInvocationId
6336 OpDecorate %31 DescriptorSet 0
6337 OpDecorate %31 Binding 0
6338 OpDecorate %31 Coherent
6339 OpDecorate %50 BuiltIn WorkgroupSize
6341 %3 = OpTypeFunction %2
6343 %7 = OpTypePointer Function %6
6345 %10 = OpTypeVector %9 3
6346 %11 = OpTypePointer Input %10
6347 %12 = OpVariable %11 Input
6348 %13 = OpConstant %9 0
6349 %14 = OpTypePointer Input %9
6350 %19 = OpConstant %9 1
6351 %24 = OpConstant %9 2
6352 %28 = OpTypeInt 64 1
6353 %29 = OpTypeImage %28 Buffer 0 0 0 2 R64i
6354 %30 = OpTypePointer UniformConstant %29
6355 %31 = OpVariable %30 UniformConstant
6356 %33 = OpConstant %6 64
6357 %47 = OpTypePointer Image %28
6358 %50 = OpConstantComposite %10 %19 %19 %19
6359 %4 = OpFunction %2 None %3
6361 %8 = OpVariable %7 Function
6362 %18 = OpVariable %7 Function
6363 %23 = OpVariable %7 Function
6364 %15 = OpAccessChain %14 %12 %13
6366 %17 = OpBitcast %6 %16
6368 %20 = OpAccessChain %14 %12 %19
6370 %22 = OpBitcast %6 %21
6372 %25 = OpAccessChain %14 %12 %24
6374 %27 = OpBitcast %6 %26
6377 %34 = OpSMod %6 %32 %33
6380 %37 = OpIMul %6 %35 %36
6383 %40 = OpIMul %6 %38 %39
6384 %41 = OpIAdd %6 %37 %40
6387 %44 = OpIMul %6 %42 %43
6388 %45 = OpIAdd %6 %41 %44
6389 %46 = OpSConvert %28 %45
6390 %48 = OpImageTexelPointer %47 %31 %34 %13
6391 %49 = ${OPNAME} %28 %48 %19 %13 ${LASTARG:default=%46}
6396 const std::string kShader_image_buffer_r64i_intermediate_values = R"(
6397 ; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been
6398 ; replaced with a template parameter and the last argument for it has been made optional.
6401 ;precision highp iimageBuffer;
6403 ;#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
6404 ;#extension GL_EXT_shader_image_int64 : require
6405 ;layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
6406 ;layout (r64i, binding=0) coherent uniform iimageBuffer u_resultImage;
6407 ;layout (r64i, binding=1) writeonly uniform iimageBuffer u_intermValuesImage;
6411 ; int gx = int(gl_GlobalInvocationID.x);
6412 ; int gy = int(gl_GlobalInvocationID.y);
6413 ; int gz = int(gl_GlobalInvocationID.z);
6414 ; imageStore(u_intermValuesImage, gx, i64vec4(imageAtomicAdd(u_resultImage, gx % 64, int(gx*gx + gy*gy + gz*gz))));
6418 ; Generator: Khronos Glslang Reference Front End; 8
6423 OpCapability Int64Atomics
6424 OpCapability ImageBuffer
6425 OpCapability Int64ImageEXT
6426 OpExtension "SPV_EXT_shader_image_int64"
6427 %1 = OpExtInstImport "GLSL.std.450"
6428 OpMemoryModel Logical GLSL450
6429 OpEntryPoint GLCompute %4 "main" %12
6430 OpExecutionMode %4 LocalSize 1 1 1
6431 OpDecorate %12 BuiltIn GlobalInvocationId
6432 OpDecorate %31 DescriptorSet 0
6433 OpDecorate %31 Binding 1
6434 OpDecorate %31 NonReadable
6435 OpDecorate %34 DescriptorSet 0
6436 OpDecorate %34 Binding 0
6437 OpDecorate %34 Coherent
6438 OpDecorate %55 BuiltIn WorkgroupSize
6440 %3 = OpTypeFunction %2
6442 %7 = OpTypePointer Function %6
6444 %10 = OpTypeVector %9 3
6445 %11 = OpTypePointer Input %10
6446 %12 = OpVariable %11 Input
6447 %13 = OpConstant %9 0
6448 %14 = OpTypePointer Input %9
6449 %19 = OpConstant %9 1
6450 %24 = OpConstant %9 2
6451 %28 = OpTypeInt 64 1
6452 %29 = OpTypeImage %28 Buffer 0 0 0 2 R64i
6453 %30 = OpTypePointer UniformConstant %29
6454 %31 = OpVariable %30 UniformConstant
6455 %34 = OpVariable %30 UniformConstant
6456 %36 = OpConstant %6 64
6457 %50 = OpTypePointer Image %28
6458 %53 = OpTypeVector %28 4
6459 %55 = OpConstantComposite %10 %19 %19 %19
6460 %4 = OpFunction %2 None %3
6462 %8 = OpVariable %7 Function
6463 %18 = OpVariable %7 Function
6464 %23 = OpVariable %7 Function
6465 %15 = OpAccessChain %14 %12 %13
6467 %17 = OpBitcast %6 %16
6469 %20 = OpAccessChain %14 %12 %19
6471 %22 = OpBitcast %6 %21
6473 %25 = OpAccessChain %14 %12 %24
6475 %27 = OpBitcast %6 %26
6477 %32 = OpLoad %29 %31
6480 %37 = OpSMod %6 %35 %36
6483 %40 = OpIMul %6 %38 %39
6486 %43 = OpIMul %6 %41 %42
6487 %44 = OpIAdd %6 %40 %43
6490 %47 = OpIMul %6 %45 %46
6491 %48 = OpIAdd %6 %44 %47
6492 %49 = OpSConvert %28 %48
6493 %51 = OpImageTexelPointer %50 %34 %37 %13
6494 %52 = ${OPNAME} %28 %51 %19 %13 ${LASTARG:default=%49}
6495 %54 = OpCompositeConstruct %53 %52 %52 %52 %52
6496 OpImageWrite %32 %33 %54
6501 } // anonymous namespace
6503 bool CaseVariant::operator< (const CaseVariant& other) const
6505 // Simple lexicographical comparison using the struct members.
6506 const std::array<int, 4> thisMembers =
6508 static_cast<int>(imageType),
6509 static_cast<int>(textureFormat.order),
6510 static_cast<int>(textureFormat.type),
6511 static_cast<int>(checkType),
6514 const std::array<int, 4> otherMembers =
6516 static_cast<int>(other.imageType),
6517 static_cast<int>(other.textureFormat.order),
6518 static_cast<int>(other.textureFormat.type),
6519 static_cast<int>(other.checkType),
6522 return thisMembers < otherMembers;
6525 CaseVariant::CaseVariant (ImageType imgtype, tcu::TextureFormat::ChannelOrder order, tcu::TextureFormat::ChannelType chtype, CheckType cktype)
6526 : imageType{imgtype}, textureFormat{order, chtype}, checkType{cktype}
6529 std::string getSpirvAtomicOpShader (const CaseVariant& caseVariant)
6531 using ShadersMapT = std::map<CaseVariant, const std::string*>;
6532 using ValueType = ShadersMapT::value_type;
6534 static const ShadersMapT kShadersMap =
6536 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_r32ui_end_result},
6537 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_r32ui_intermediate_values},
6538 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_r32i_end_result},
6539 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_r32i_intermediate_values},
6540 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_array_r32ui_end_result},
6541 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_array_r32ui_intermediate_values},
6542 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_array_r32i_end_result},
6543 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_array_r32i_intermediate_values},
6544 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_r32ui_end_result},
6545 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_r32ui_intermediate_values},
6546 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_r32i_end_result},
6547 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_r32i_intermediate_values},
6548 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_array_r32ui_end_result},
6549 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_array_r32ui_intermediate_values},
6550 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_array_r32i_end_result},
6551 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_array_r32i_intermediate_values},
6552 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_3d_r32ui_end_result},
6553 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_3d_r32ui_intermediate_values},
6554 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_3d_r32i_end_result},
6555 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_3d_r32i_intermediate_values},
6556 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_r32ui_end_result},
6557 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_r32ui_intermediate_values},
6558 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_r32i_end_result},
6559 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_r32i_intermediate_values},
6560 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_array_r32ui_end_result},
6561 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_array_r32ui_intermediate_values},
6562 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_array_r32i_end_result},
6563 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_array_r32i_intermediate_values},
6564 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_image_buffer_r32ui_end_result},
6565 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_image_buffer_r32ui_intermediate_values},
6566 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_image_buffer_r32i_end_result},
6567 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT32, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_image_buffer_r32i_intermediate_values},
6569 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_r64ui_end_result},
6570 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_r64ui_intermediate_values},
6571 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_r64i_end_result},
6572 ValueType{CaseVariant{IMAGE_TYPE_1D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_r64i_intermediate_values},
6573 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_array_r64ui_end_result},
6574 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_array_r64ui_intermediate_values},
6575 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_1d_array_r64i_end_result},
6576 ValueType{CaseVariant{IMAGE_TYPE_1D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_1d_array_r64i_intermediate_values},
6577 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_r64ui_end_result},
6578 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_r64ui_intermediate_values},
6579 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_r64i_end_result},
6580 ValueType{CaseVariant{IMAGE_TYPE_2D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_r64i_intermediate_values},
6581 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_array_r64ui_end_result},
6582 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_array_r64ui_intermediate_values},
6583 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_2d_array_r64i_end_result},
6584 ValueType{CaseVariant{IMAGE_TYPE_2D_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_2d_array_r64i_intermediate_values},
6585 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_3d_r64ui_end_result},
6586 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_3d_r64ui_intermediate_values},
6587 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_3d_r64i_end_result},
6588 ValueType{CaseVariant{IMAGE_TYPE_3D, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_3d_r64i_intermediate_values},
6589 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_r64ui_end_result},
6590 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_r64ui_intermediate_values},
6591 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_r64i_end_result},
6592 ValueType{CaseVariant{IMAGE_TYPE_CUBE, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_r64i_intermediate_values},
6593 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_array_r64ui_end_result},
6594 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_array_r64ui_intermediate_values},
6595 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_cube_array_r64i_end_result},
6596 ValueType{CaseVariant{IMAGE_TYPE_CUBE_ARRAY, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_cube_array_r64i_intermediate_values},
6597 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_image_buffer_r64ui_end_result},
6598 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::UNSIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_image_buffer_r64ui_intermediate_values},
6599 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_END_RESULTS}, &kShader_image_buffer_r64i_end_result},
6600 ValueType{CaseVariant{IMAGE_TYPE_BUFFER, tcu::TextureFormat::R, tcu::TextureFormat::SIGNED_INT64, CaseVariant::CHECK_TYPE_INTERMEDIATE_RESULTS}, &kShader_image_buffer_r64i_intermediate_values},
6603 const auto iter = kShadersMap.find(caseVariant);
6604 DE_ASSERT(iter != kShadersMap.end());
6605 return *(iter->second);
6608 } // namespace image
6611 // Note: the SPIR-V shaders above were created using the atomic addition shaders as a base, replacing OpAtomicIAdd with a string
6612 // template and making the last operation argument optional. Because the atomic addition shaders are generated, the final version of
6613 // each shader was obtained from TestResults.qpa after running the whole atomic addition group, using the Python script documented
6628 header_printed = False
6630 for line in sys.stdin:
6631 if line.startswith("#beginTestCaseResult"):
6632 test_name = line.strip().split()[1]
6633 test_name = "_".join(test_name.split(".")[-2:])
6635 if "<ShaderSource>" in line:
6636 line = re.sub(r".*<ShaderSource>", "", line)
6639 if "</ShaderSource>" in line:
6642 if "<SpirVAssemblySource>" in line:
6643 line = re.sub(r".*<SpirVAssemblySource>", "", line)
6646 if "</SpirVAssemblySource>" in line:
6648 if not header_printed:
6649 print("#include <string>")
6651 header_printed = True
6652 print("const std::string kShader_%s = R\"(" % (test_name,))
6653 print("; The SPIR-V shader below is based on the following GLSL shader, but OpAtomicIAdd has been")
6654 print("; replaced with a template parameter and the last argument for it has been made optional.")
6656 for glsl_line in glsl_lines:
6657 glsl_line = html.unescape(glsl_line)
6658 print("; %s" % (glsl_line,), end="")
6660 for spirv_line in spirv_lines:
6661 spirv_line = html.unescape(spirv_line)
6662 if "OpAtomicIAdd" in spirv_line:
6663 words = spirv_line.strip().split()
6664 for i in range(len(words)):
6665 if words[i] == "OpAtomicIAdd":
6666 words[i] = r"${OPNAME}"
6667 words[-1] = r"${LASTARG:default=%s}" % (words[-1], )
6668 spirv_line = " ".join(words) + "\n"
6669 print("%s" % (spirv_line, ), end="")
6677 if state == STATE_GLSL:
6678 glsl_lines.append(line)
6679 elif state == STATE_SPIRV:
6680 spirv_lines.append(line)