45116361d9b1e17f8b73234fa016715465b52fdd
[platform/upstream/glslang.git] / Test / spv.310.comp
1 #version 310 es
2
3 precision highp float;
4
5 layout (local_size_x = 16, local_size_y = 32, local_size_z = 4) in;
6
7 shared float s;
8 shared int i;
9
10 buffer outb {
11     float f;
12     float g;
13     float h;
14     vec3 uns[];  // this makes it look like the "second" set of 3 floats in a struct, which LLVM
15                  // takes advantage of when optimizing, giving confusing results, like thinking
16                  // &outbname.uns[18].x == &outbname[9].uns.x
17 } outbname;
18
19 buffer outbna {
20     int k;
21     vec4 na;
22 } outbnamena;
23
24 buffer outs {
25     vec4 va[];
26 } outnames;
27
28 void main()
29 {
30     barrier();
31     outbname.f = s;
32     outbnamena.na = vec4(s);
33     s = outbname.uns[18].x;           // TODO: see note above
34     //outbname.uns[17] = vec3(3.0);   // TODO: see note above, this one bitcasts, which isn't handled
35     outbname.uns[i] = vec3(s);
36     outnames.va[gl_LocalInvocationID.x] = vec4(s);
37 }