spv.subgroupClusteredNeg.comp 1.4 KB

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