1#version 320 es 2 3#extension GL_KHR_shader_subgroup_clustered: enable 4 5layout (local_size_x = 8) in; 6 7layout(binding = 0) buffer Buffers 8{ 9 vec4 f4; 10 ivec4 i4; 11 uvec4 u4; 12} data[4]; 13 14void main() 15{ 16 int a = 1; 17 const int aConst = 1; 18 19 uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; 20 21 data[0].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0u); // ERROR, less than 1 22 23 data[0].f4.x = subgroupClusteredMul(data[0].f4.x, 3u); // ERROR, not a power of 2 24 25 data[1].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8u); 26 data[1].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6u); // ERROR, not a power of 2 27 28 data[3].i4.x = subgroupClusteredOr(data[0].i4.x, uint(a)); // ERROR, not constant 29 data[3].i4.xy = subgroupClusteredOr(data[1].i4.xy, uint(aConst)); 30 31 data[0].i4.x = subgroupClusteredXor(data[0].i4.x, uint(1 + a)); // ERROR, not constant 32 data[0].i4.xy = subgroupClusteredXor(data[1].i4.xy, uint(aConst + a)); // ERROR, not constant 33 data[0].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, uint(1 + aConst)); 34} 35