File: spv.subgroupClusteredNeg.comp

package info (click to toggle)
glslang 16.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,712 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (39 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#version 450

#extension GL_KHR_shader_subgroup_clustered: enable

layout (local_size_x = 8) in;

layout(binding = 0) buffer Buffers
{
    vec4  f4;
    ivec4 i4;
    uvec4 u4;
    dvec4 d4;
} data[4];

void main()
{
    int a = 1;
    const int aConst = 1;

    uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4;

    data[invocation].f4.xy  = subgroupClusteredAdd(data[1].f4.xy, 0);          // ERROR, less than 1

    data[invocation].f4.x   = subgroupClusteredMul(data[0].f4.x, 3);           // ERROR, not a power of 2

    data[invocation].i4.xy  = subgroupClusteredMin(data[1].i4.xy, 8);
    data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6);         // ERROR, not a power of 2

    data[invocation].f4.x   = subgroupClusteredMax(data[0].f4.x, -1);          // ERROR, less than 1

    data[invocation].i4     = subgroupClusteredAnd(data[3].i4, -3);            // ERROR, less than 1

    data[invocation].i4.x   = subgroupClusteredOr(data[0].i4.x, a);            // ERROR, not constant
    data[invocation].i4.xy  = subgroupClusteredOr(data[1].i4.xy, aConst);

    data[invocation].i4.x   = subgroupClusteredXor(data[0].i4.x, 1 + a);       // ERROR, not constant
    data[invocation].i4.xy  = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant
    data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst);
}