1617a3babSopenharmony_ci#version 320 es
2617a3babSopenharmony_ci
3617a3babSopenharmony_ci#extension GL_KHR_shader_subgroup_clustered: enable
4617a3babSopenharmony_ci
5617a3babSopenharmony_cilayout (local_size_x = 8) in;
6617a3babSopenharmony_ci
7617a3babSopenharmony_cilayout(binding = 0) buffer Buffers
8617a3babSopenharmony_ci{
9617a3babSopenharmony_ci    vec4  f4;
10617a3babSopenharmony_ci    ivec4 i4;
11617a3babSopenharmony_ci    uvec4 u4;
12617a3babSopenharmony_ci} data[4];
13617a3babSopenharmony_ci
14617a3babSopenharmony_civoid main()
15617a3babSopenharmony_ci{
16617a3babSopenharmony_ci    int a = 1;
17617a3babSopenharmony_ci    const int aConst = 1;
18617a3babSopenharmony_ci
19617a3babSopenharmony_ci    uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u;
20617a3babSopenharmony_ci
21617a3babSopenharmony_ci    data[0].f4.xy  = subgroupClusteredAdd(data[1].f4.xy, 0u);          // ERROR, less than 1
22617a3babSopenharmony_ci
23617a3babSopenharmony_ci    data[0].f4.x   = subgroupClusteredMul(data[0].f4.x, 3u);           // ERROR, not a power of 2
24617a3babSopenharmony_ci
25617a3babSopenharmony_ci    data[1].i4.xy  = subgroupClusteredMin(data[1].i4.xy, 8u);
26617a3babSopenharmony_ci    data[1].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6u);         // ERROR, not a power of 2
27617a3babSopenharmony_ci
28617a3babSopenharmony_ci    data[3].i4.x   = subgroupClusteredOr(data[0].i4.x, uint(a));            // ERROR, not constant
29617a3babSopenharmony_ci    data[3].i4.xy  = subgroupClusteredOr(data[1].i4.xy, uint(aConst));
30617a3babSopenharmony_ci
31617a3babSopenharmony_ci    data[0].i4.x   = subgroupClusteredXor(data[0].i4.x, uint(1 + a));       // ERROR, not constant
32617a3babSopenharmony_ci    data[0].i4.xy  = subgroupClusteredXor(data[1].i4.xy, uint(aConst + a)); // ERROR, not constant
33617a3babSopenharmony_ci    data[0].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, uint(1 + aConst));
34617a3babSopenharmony_ci}
35