Merge pull request #2891 from dneto0/hlsl-namespace
[platform/upstream/glslang.git] / Test / glsl.es320.subgroupShuffleRelative.comp
1 #version 320 es\r
2 \r
3 #extension GL_KHR_shader_subgroup_shuffle_relative: enable\r
4 \r
5 layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;\r
6 \r
7 layout(binding = 0) buffer Buffers\r
8 {\r
9     vec4  f4;\r
10     ivec4 i4;\r
11     uvec4 u4;\r
12 } data[4];\r
13 \r
14 void main()\r
15 {\r
16     uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u;\r
17 \r
18     data[0].f4.x   = subgroupShuffleUp(data[0].f4.x,    invocation);\r
19     data[0].f4.xy  = subgroupShuffleUp(data[1].f4.xy,   invocation);\r
20     data[0].f4.xyz = subgroupShuffleUp(data[2].f4.xyz,  invocation);\r
21     data[0].f4     = subgroupShuffleUp(data[3].f4,      invocation);\r
22 \r
23     data[0].i4.x   = subgroupShuffleUp(data[0].i4.x,    invocation);\r
24     data[0].i4.xy  = subgroupShuffleUp(data[1].i4.xy,   invocation);\r
25     data[0].i4.xyz = subgroupShuffleUp(data[2].i4.xyz,  invocation);\r
26     data[0].i4     = subgroupShuffleUp(data[3].i4,      invocation);\r
27 \r
28     data[1].u4.x   = subgroupShuffleUp(data[0].u4.x,    invocation);\r
29     data[1].u4.xy  = subgroupShuffleUp(data[1].u4.xy,   invocation);\r
30     data[1].u4.xyz = subgroupShuffleUp(data[2].u4.xyz,  invocation);\r
31     data[1].u4     = subgroupShuffleUp(data[3].u4,      invocation);\r
32 \r
33     data[1].i4.x   =   int(subgroupShuffleUp(data[0].i4.x < 0,                   invocation));\r
34     data[1].i4.xy  = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)),  invocation));\r
35     data[1].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation));\r
36     data[1].i4     = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)),     invocation));\r
37 \r
38     data[2].f4.x   = subgroupShuffleDown(data[0].f4.x,    invocation);\r
39     data[2].f4.xy  = subgroupShuffleDown(data[1].f4.xy,   invocation);\r
40     data[2].f4.xyz = subgroupShuffleDown(data[2].f4.xyz,  invocation);\r
41     data[2].f4     = subgroupShuffleDown(data[3].f4,      invocation);\r
42 \r
43     data[2].i4.x   = subgroupShuffleDown(data[0].i4.x,    invocation);\r
44     data[2].i4.xy  = subgroupShuffleDown(data[1].i4.xy,   invocation);\r
45     data[2].i4.xyz = subgroupShuffleDown(data[2].i4.xyz,  invocation);\r
46     data[2].i4     = subgroupShuffleDown(data[3].i4,      invocation);\r
47 \r
48     data[3].u4.x   = subgroupShuffleDown(data[0].u4.x,    invocation);\r
49     data[3].u4.xy  = subgroupShuffleDown(data[1].u4.xy,   invocation);\r
50     data[3].u4.xyz = subgroupShuffleDown(data[2].u4.xyz,  invocation);\r
51     data[3].u4     = subgroupShuffleDown(data[3].u4,      invocation);\r
52 \r
53     data[3].i4.x   =   int(subgroupShuffleDown(data[0].i4.x < 0,                   invocation));\r
54     data[3].i4.xy  = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)),  invocation));\r
55     data[3].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation));\r
56     data[3].i4     = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)),     invocation));\r
57 }\r